ThiagoBarradas / serilog-sinks-newrelic-logs

A Serilog sink that writes events to the NewRelic Logs.
https://www.nuget.org/packages/Serilog.Sinks.NewRelic.Logs
Other
31 stars 15 forks source link

Feature request: Change the value send for level "Information" #13

Open GuusRaaphorst opened 2 years ago

GuusRaaphorst commented 2 years ago

Hi,

We are using your package to send the logging from our function apps to New Relic. That works like a charm. The logging that is send from other places in our application landscape however send as value for loglevel 'info' instead of 'Information'.

Actual behaviour

I can see in the code that the value for level is determined based on Level.ToString(). The LogEventLevel value is Information, so it will send 'Information'.

Desired behaviour

It would be great if we can somehow influence the conversion from logevent.Level to attribute value.

A suggestion would be to make NewRelicPropertyFormatter overridable, extensible or replaceable. Then use AddProperty when adding the log event or call the simplify method (or a new method for this specific case) on the value before adding it.

But perhaps there are solutions that better fit the desired future of this package?

Kind regards, Guus