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
Copy file name to clipboardExpand all lines: README.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -320,6 +320,7 @@ This is a `Collection<>` of `SqlColumn` objects that you create to define custom
320
320
Each Standard Column in the `ColumnOptions.Store` list and any custom columns you add to the `AdditionalColumns` collection are `SqlColumn` objects with the following properties:
321
321
322
322
*`ColumnName`
323
+
*`PropertyName`
323
324
*`DataType`
324
325
*`AllowNull`
325
326
*`DataLength`
@@ -329,6 +330,10 @@ Each Standard Column in the `ColumnOptions.Store` list and any custom columns yo
329
330
330
331
Any valid SQL column name can be used. Standard Columns have default names assigned but these can be changed without affecting their special handling.
331
332
333
+
### PropertyName
334
+
335
+
The optional name of a Serilog property to use as the value for the SqlColumn. If not provided, the property used is the one that has the same name as the specified ColumnName.
336
+
332
337
### DataType
333
338
334
339
This property can be set to nearly any value in the `System.Data.SqlDbType` enumeration. Unlike previous versions of this sink, SQL column types are fully supported end-to-end, including auto-table-creation. Earlier limitations imposed by the use of the .NET `DataColumn` object no longer apply. Most of the Standard Columns only support a limited subset of the SQL column types (and often just one type). Some of the special-case SQL column types are excluded such as `timestamp` and `udt`, and deprecated types like `text` and `image` are excluded. These are the supported SQL column data types:
@@ -482,7 +487,7 @@ var columnOptions = new ColumnOptions
@@ -499,7 +504,7 @@ var log = new LoggerConfiguration()
499
504
.CreateLogger();
500
505
```
501
506
502
-
In this example, when a log event contains any of the properties `UserName`, `UserId`, and `RequestUri`, the property values would be written to the corresponding columns. The property names must match exactly (case-insensitive).
507
+
In this example, when a log event contains any of the properties `UserName`, `UserId`, and `RequestUri`, the property values would be written to the corresponding columns. The property names must match exactly (case-insensitive). In the case of `UserName`, that value would be written to the column named `EnvironmentUserName`.
503
508
504
509
Unlike previous versions of the sink, Standard Column names are not reserved. If you remove the `Id` Standard Column from the `ColumnOptions.Store` list, you are free to create a new custom column called `Id` which the sink will treat like any other custom column fully under your control.
505
510
@@ -568,6 +573,7 @@ As the name suggests, `columnOptionSection` is an entire configuration section i
0 commit comments