You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please refer to the [Serilog Code of Conduct](https://github.com/serilog/serilog/blob/dev/CODE_OF_CONDUCT.md) which covers all repositories within the Serilog Organization.
Copy file name to clipboardExpand all lines: README.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ All sink configuration methods accept the following arguments, though not necess
35
35
*`batchPostingLimit`
36
36
*`period`
37
37
*`formatProvider`
38
+
*`logEventFormatter`
38
39
39
40
### Basic Arguments
40
41
@@ -54,6 +55,8 @@ Consider increasing the batch size in high-volume logging environments. In one t
54
55
55
56
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.
56
57
58
+
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).
59
+
57
60
### Platform-Specific Arguments
58
61
59
62
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.
@@ -154,6 +157,7 @@ The constructor accepts most of the same arguments, and like other Serilog audit
154
157
*`autoCreateSqlTable`
155
158
*`columnOptions`
156
159
*`formatProvider`
160
+
*`logEventFormatter`
157
161
158
162
The `restrictedToMinimumLevel` parameter is not available because all events written to an audit sink are required to succeed.
159
163
@@ -408,6 +412,8 @@ This column stores log event property values as JSON. Typically you will use eit
408
412
409
413
The `ExcludeAddtionalProperties` and `ExcludeStandardColumns` properties are described in the [Custom Property Columns](#custom-property-columns) topic.
410
414
415
+
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).
416
+
411
417
## Custom Property Columns
412
418
413
419
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)`.
@@ -554,12 +560,12 @@ Keys and values are case-sensitive. Case must match **_exactly_** as shown below
0 commit comments