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

Add support for configuration by environment variables #5

Open nmehlei opened 3 years ago

nmehlei commented 3 years ago

Status

TASK

Checklist

Expected behaviour

The dotnet agent for New Relic can already be configured via environment variables, e.g. NEW_RELIC_LICENSE_KEY and NEW_RELIC_APP_NAME, which can be helpful in some hosting environments like Kubernetes. It would be great if this library could also use these values IF they are not already configured explicitly in e.g. the appsettings.json file. In my specific case, I would have to configure it both in environment variables as well as inside the appsettings.json. Especially the latter is both error-prone but also quite complicated when using Docker (and thus this sensible data is inside the docker container itself).

ThiagoBarradas commented 3 years ago

Please, can you test version 1.2.0-preview.1??

Let me know if all works fine to release final version as 1.2.0.

Thanks!!!

nmehlei commented 3 years ago

Thank you for the quick response! I'm currently testing it out, looks promising. Will get back to you afterwards.

nmehlei commented 3 years ago

Unfortunately, when configuring it this way, logs don't seem to reach New Relic. Just to confirm, this is supposed to be compatible with the configuration via JSON as well (i.e. without using the explicit .WriteTo.NewRelicLogs()), correct?