Skip to content

Commit a8d5417

Browse files
authored
Note on JSON formatting option
1 parent 907752a commit a8d5417

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ Log.Logger = new LoggerConfiguration()
9393

9494
Note the use of `{Items[0]}`: "holes" in expression templates can include any valid expression.
9595

96+
Newline-delimited JSON (for example, emulating the [CLEF format](https://github.com/serilog/serilog-formatting-compact)) can be generated
97+
using object literals:
98+
99+
```csharp
100+
.WriteTo.Console(new ExpressionTemplate(
101+
"{ {@t, @mt, @l: if @l = 'Information' then undefined() else @l, @x, ..@p} }\n"))
102+
```
103+
96104
## Language reference
97105

98106
### Built-in properties

0 commit comments

Comments
 (0)