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
In addition to any special properties described below, each Standard Column also has the usual column properties like `ColumnName` as described in the topic [SqlColumn Objects](#sqlcolumn-objects).
@@ -454,7 +458,7 @@ In case `DataLength` is set to a specific value different from -1, any message l
454
458
455
459
Thiscolumnstoresthelogeventmessagewiththepropertyplaceholders. Itdefaultsto `nvarchar(max)`. The `DataType` propertycanonlybesettocharacter-storagetypes.
If`DataLength` issettoavaluedifferentto -1longertextwillbetruncated. See [Messagecolumn](#message) fordetails.
458
462
459
463
### Level
460
464
@@ -484,7 +488,7 @@ When the `ConvertToUtc` property is set to `true`, the time stamp is adjusted to
484
488
485
489
When an exception is logged as part of the log event, the exception message is stored here automatically. The `DataType` must be `nvarchar`.
486
490
487
-
Similar to the columns `Message` and `MessageTemplate`, setting `DataLength`of `Exception`to a specific value different from -1 will effectively truncate any exception message to the stated length in `DataLength`.
491
+
Similar to the columns `Message` and `MessageTemplate`, setting `DataLength` to a specific value different from -1 will effectively truncate any exception message to the stated length in `DataLength`. See [Message column](#message) for details.
488
492
489
493
### Properties
490
494
@@ -506,13 +510,22 @@ If `OmitElementIfEmpty` is set then if a property is empty, it will not be seria
506
510
507
511
This column stores log event property values as JSON. Typically you will use either this column or the XML-based `Properties` column, but not both. This column's `DataType` must always be `nvarchar`.
508
512
509
-
The `ExcludeAddtionalProperties` and `ExcludeStandardColumns` properties are described in the [Custom Property Columns](#custom-property-columns) topic.
513
+
By default this column is not used unless it is added to the `ColumnOptions.Store` property as documented [above](#standard-columns).
510
514
511
515
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](#sink-configuration).
512
516
517
+
### TraceId and SpanId
518
+
519
+
These two columns store the OpenTelemetry `TraceId` and `SpanId` log event properties which are documented [here](https://github.com/serilog/serilog/issues/1923). The `DataType` of these columns must be `nvarchar` or `varchar`.
520
+
521
+
By default these columns are not used unless they are added to the `ColumnOptions.Store` property as documented [above](#standard-columns).
522
+
513
523
## Custom Property Columns
514
524
515
-
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)`. If you specify a DataLength on a column of character data types (NVarChar, VarChar, Char, NChar) the string will be automatically truncated to the datalength to fit in the column.
525
+
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)`.
526
+
527
+
If you specify a DataLength other than -1 on a column of character data types (NVarChar, VarChar, Char, NChar) longer text will be truncated to the specified length. See [Message column](#message) for details.
528
+
516
529
517
530
```csharp
518
531
varcolumnOptions=newColumnOptions
@@ -601,7 +614,7 @@ As the name suggests, `columnOptionSection` is an entire configuration section i
Copy file name to clipboardExpand all lines: src/Serilog.Sinks.MSSqlServer/Configuration/Implementations/Microsoft.Extensions.Configuration/MicrosoftExtensionsColumnOptionsProvider.cs
Copy file name to clipboardExpand all lines: src/Serilog.Sinks.MSSqlServer/Configuration/Implementations/System.Configuration/MSSqlServerConfigurationSection.cs
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,18 @@ public StandardColumnConfigLevel Level
Copy file name to clipboardExpand all lines: src/Serilog.Sinks.MSSqlServer/Configuration/Implementations/System.Configuration/SystemConfigurationColumnOptionsProvider.cs
0 commit comments