SumoLogic / sumologic-net-appenders

Several appenders for .NET developers to use that send logs straight to SumoLogic.
Apache License 2.0
23 stars 39 forks source link

Channels #30

Closed ischyrus closed 7 years ago

ischyrus commented 7 years ago

I have been logging to Sumo using a library I found but decided to switch to using the NLog appender for various benefits it adds. In the Sumo library I was using I was able to send in the 'name' (which I called the channel name) as a header called "X-Sumo-Name" that let me categorize my logs. Is it possible to retain this name\channel variable when using the NLog appender?

latkin commented 7 years ago

Hi @ischyrus, apologies for delayed reply.

Yes, you can configure X-Sumo-Name via the XML config setting <SourceName>ExampleNameNLogBufferedTarget</SourceName> as shown in the README.

If you want to set this dynamically in code, I think there are NLog APIs that allow dynamic changes to appender properties.