- 2 minutes to read
Settings Section (appsettings.json)
You can read and learn about the Settings section of your appsettings.json file on this page.
...
"Settings": {
"LogAgentValueId": 503,
"EndPointName": "Nodinite.Serilog.Sink.Tests",
"EndPointUri": "Nodinite.Serilog.Sink.Tests.Serilog",
"EndPointDirection": 0,
"EndPointTypeId": 0,
"OriginalMessageTypeName": "REPLACEDBYCODE",
"ProcessingUser": "NODINITE",
"ProcessName": "Nodinite.Serilog.Sink.Tests",
"ProcessingMachineName": "NODINITE-DEV",
"ProcessingModuleName": "DOTNETCORE.TESTS",
"ProcessingModuleType": "DOTNETCORE.TESTPROJECT",
"LogOnlyMessagesWithBody": "true",
"ReplaceRules": {
"Body": [ "InputMessage", "OutputMessage" ],
"ApplicationInterchangeId": [ "EventID" ],
"LogStatus": [ "StatusCode" ]
}
...
New 2.0.22 "LogOnlyMessagesWithBody" is a new property that by default logs ALL events. If you set this to true, there must be a Body or at least one Body in the Bodies collection for a log to be written. This new behaviour may be applied to all Nodinite Serilog sinks.
New 2.0.35 You can Log Events with a Log Status Code adding a new EventId(1337, "Elite")
to the Serilog logging.
New 2.0.35 ReplaceRules can be used to map Semantic Logging to map data to the structure of a Nodinite JSON Log Event.
_logger.LogInformation(new EventId(1337, "Elite"), "Hello {CustomContextValue}! {Input-Message} {Bodies} {QQQ} {OriginalMessageType} {EndPointName} {EndPointUri} {EndPointDirection} {EndPointTypeId} {EventDirection} {ProcessingTime} {EventNumber} {SequenceNo} {LocalInterchangeId} {ServiceInstanceActivityId} {KALLEKULA}",
"Custom Context Value",
"MyBody",
"[\"MyBody1\",\"MyBody2\"]",
"MyApplicationInterchangeId",
"MyOriginalMessageType",
"MyEndPointName",
"MyEndPointUri",
"1", // EndPointDirection
"1", // EndPointTypeId
"1", // EventDirection
"1", // ProcessingTime
"1", // EventNumber
"1", // SequenceNo
Guid.NewGuid(), // LocalInterchangeId
Guid.NewGuid() // ServiceInstanceActivityId
);