Skip to content

Commit 5c0b80f

Browse files
andypeetersckadluba
authored andcommitted
Extend README.md with explanation about the trimming effect when the field lengths are set to a specific size
1 parent 8230a31 commit 5c0b80f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ A flag specifiying if the log events table should be created if it does not exis
265265
### EnlistInTransaction
266266

267267
A flag to make logging SQL commands take part in ambient transactions. It defaults to `false`.
268-
Logging operations could be affected from surrounding `TransactionScope´s in the code, leading to log data
268+
Logging operations could be affected from surrounding `TransactionScopes in the code, leading to log data
269269
being removed on a transaction rollback. This is by default prevented by the sink adding `Enlist=false` to
270270
the `ConnectionString` that is passed. This option can be used to change this behavior so that `Enlist=true`
271271
is added instead (which is the default for SQL connections) and logging commands might be part of transactions.
@@ -460,10 +460,14 @@ _BigInt data type:_ For very large log tables, if you absolutely require an iden
460460

461461
This column stores the formatted output (property placeholders are replaced with property values). It defaults to `nvarchar(max)`. The `DataType` property can only be set to character-storage types.
462462

463+
In case `DataLength` is set to a specific value different from -1 or 0, any message longer than that length will be effectively trimmed down to that size. Example: `DataLength` is set to 15 and the message is "this is a very long message" (without the quotes), the trimmed text stored in the database will be: "this is a ve..." (again without quotes).
464+
463465
### MessageTemplate
464466

465467
This column stores the log event message with the property placeholders. It defaults to `nvarchar(max)`. The `DataType` property can only be set to character-storage types.
466468

469+
In case `DataLength` is set to a specific value different from -1 or 0, any template text longer than that length will be effectively trimmed down to that size. Any trimming ignores all differences between the tokens in the template meaning that a template might get cut off in the middle of a property token. Example: `DataLength` is set to 20 and the message template is "a long {NumberOfCharacters} template text" (without the quotes), the final template stored in the database will be: "a long {NumberOfC..." (again without quotes).
470+
467471
### Level
468472

469473
This column stores the event level (Error, Information, etc.). For backwards-compatibility reasons it defaults to a length of 128 characters, but 12 characters is recommended. Alternately, the `StoreAsEnum` property can be set to `true` which causes the underlying level enum integer value to be stored as a SQL `tinyint` column. The `DataType` property can only be set to `nvarchar` or `tinyint`. Setting the `DataType` to `tinyint` is identical to setting `StoreAsEnum` to `true`.

0 commit comments

Comments
 (0)