Skip to content

Commit

Permalink
Default mdc key is correlationId with a lowercase C
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Chédru committed Feb 1, 2018
1 parent 16a91a9 commit 326e6e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Correlation ids for Dropwizard applications. They are useful to match requests between different components.
- Correlation ids are sent from one system to another using an http header in requests and responses. The default http header is `X-Correlation-Id`.
- When the server processes a request, its correlation id (or a random UUID if not available) is put into [slf4j mapped diagnostic context (MDC)](https://www.slf4j.org/manual.html#mdc). The default MDC key is `CorrelationId`.
- When the server processes a request, its correlation id (or a random UUID if not available) is put into [slf4j mapped diagnostic context (MDC)](https://www.slf4j.org/manual.html#mdc). The default MDC key is `correlationId`.
- When using a Jersey or Apache http client to send requests to another system, the correlation id currently in the MDC (or a random UUID if not available) is put into the request http header.

## Usage
Expand All @@ -20,7 +20,7 @@ This project is available in the [Central Repository](http://search.maven.org/#s
<dependency>
<groupId>org.dhatim</groupId>
<artifactId>dropwizard-correlation-id</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public CorrelationIdConfiguration() {
public CorrelationIdConfiguration(@JsonProperty("headerName") String headerName,
@JsonProperty("mdcKey") String mdcKey) {
this.headerName = Optional.ofNullable(headerName).orElse("X-Correlation-Id");
this.mdcKey = Optional.ofNullable(mdcKey).orElse("CorrelationId");
this.mdcKey = Optional.ofNullable(mdcKey).orElse("correlationId");
}

}

0 comments on commit 326e6e1

Please sign in to comment.