Skip to content

Commit 1e13557

Browse files
authored
Merge pull request #235 from ckadluba/dev
Updated documentation regarding new logEventFormatter parameter.
2 parents 8514922 + c8a52ad commit 1e13557

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ All sink configuration methods accept the following arguments, though not necess
3434
* `batchPostingLimit`
3535
* `period`
3636
* `formatProvider`
37+
* `logEventFormatter`
3738

3839
### Basic Arguments
3940

@@ -53,6 +54,8 @@ Consider increasing the batch size in high-volume logging environments. In one t
5354

5455
Refer to the Serilog Wiki's explanation of [Format Providers](https://github.com/serilog/serilog/wiki/Formatting-Output#format-providers) for details about the `formatProvider` arguments.
5556

57+
The parameter `logEventFormatter` can be used to specify a custom renderer implementing `ITextFormatter` which will be used to generate the contents of the `LogEvent`column. If the parameter is omitted or set to null, the default internal JSON formatter will be used. For more information about custom text formatters refer to the Serilog documentation [Custom text formatters](https://github.com/serilog/serilog/wiki/Formatting-Output#custom-text-formatters).
58+
5659
### Platform-Specific Arguments
5760

5861
These additional arguments are accepted when the sink is configured from a library or application that supports the .NET Standard-style _Microsoft.Extensions.Configuration_ packages. They are optional.
@@ -153,6 +156,7 @@ The constructor accepts most of the same arguments, and like other Serilog audit
153156
* `autoCreateSqlTable`
154157
* `columnOptions`
155158
* `formatProvider`
159+
* `logEventFormatter`
156160

157161
The `restrictedToMinimumLevel` parameter is not available because all events written to an audit sink are required to succeed.
158162

@@ -407,6 +411,8 @@ This column stores log event property values as JSON. Typically you will use eit
407411

408412
The `ExcludeAddtionalProperties` and `ExcludeStandardColumns` properties are described in the [Custom Property Columns](#custom-property-columns) topic.
409413

414+
The content of this column is rendered as JSON by default or with a custom ITextFormatter passed by the caller as parameter `logEventFormatter`. Details can be found in [Sink Configuration Options](#sink-configuration-options).
415+
410416
## Custom Property Columns
411417

412418
By default, any log event properties you include in your log statements will be saved to the XML `Properties` column or the JSON `LogEvent` column. But they can also be stored in their own individual columns via the `AdditionalColumns` collection. This adds overhead to write operations but is very useful for frequently-queried properties. Only `ColumnName` is required; the default configuration is `varchar(max)`.

0 commit comments

Comments
 (0)