Skip to content

Commit

Permalink
Principle-of-least-surprise - use RenderedCompactJsonFormatter in the…
Browse files Browse the repository at this point in the history
… example JSON configuration
  • Loading branch information
nblumhardt committed Aug 15, 2019
1 parent 7737b6d commit 083b684
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Install-Package Serilog.Formatting.Compact
Pass a formatter to the `Console()` configuration method:

```csharp
.WriteTo.Console(new CompactJsonFormatter())
.WriteTo.Console(new RenderedCompactJsonFormatter())
```

Output theming is not available when custom formatters are used.
Expand Down Expand Up @@ -156,18 +156,6 @@ To configure the console sink with a different theme and include the `SourceCont
}
```

### Upgrading from _Serilog.Sinks.Console_ 2.x

To achieve output identical to version 2 of this sink, specify a formatter and output template explicitly:

```csharp
.WriteTo.Console(new MessageTemplateTextFormatter(
"{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {Message}{NewLine}{Exception}",
null))
```

This will bypass theming and use Serilog's built-in message template formatting.

### Contributing

Would you like to help make the Serilog console sink even better? We keep a list of issues that are approachable for newcomers under the [up-for-grabs](https://github.com/serilog/serilog-sinks-console/issues?labels=up-for-grabs&state=open) label. Before starting work on a pull request, we suggest commenting on, or raising, an issue on the issue tracker so that we can help and coordinate efforts. For more details check out our [contributing guide](CONTRIBUTING.md).
Expand Down

0 comments on commit 083b684

Please sign in to comment.