Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish code samples so that they are easier to copy & paste #5038

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/features/container_logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ By default both standard out and standard error will both be emitted at INFO lev
Standard error may be emitted at ERROR level, if desired:

```java
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log).withSeparateOutputStreams()
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(LOGGER).withSeparateOutputStreams();
```

The [Mapped Diagnostic Context (MDC)](http://logback.qos.ch/manual/mdc.html) for emitted messages may be configured using the `withMdc(...)` option:

```java
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log).withMdc("key", "value")
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(LOGGER).withMdc("key", "value");
```

or using an existing map of key-value pairs:

```java
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log).withMdc(map)
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(LOGGER).withMdc(map);
```

### Capturing container output as a String
Expand Down