datalust / seq-forwarder

Local collection and reliable forwarding of log data to Seq
Apache License 2.0
57 stars 15 forks source link

Environment variable-based configuration #55

Closed nblumhardt closed 3 years ago

nblumhardt commented 3 years ago

Currently settings from SeqForwarder.json don't have environment variable counterparts (the way that Seq settings do). For use cases like Docker packaging, this would be really convenient.

coderpatros commented 3 years ago

@nblumhardt would you take a PR for this? @stevekirks

nblumhardt commented 3 years ago

Hi @coderpatros - Yes, I think it would be a great PR, if you are keen! 👍

Quick brain dump: there are a couple of gotchas, like, when we read the config to run the forwarder, we want environment variables merged in, but when the config command is used to read/describe/write the config file, the env vars should (probably) be ignored.

We'd also plan to keep it quite close to how Seq does configuration; e.g. the output.serverUrl config setting would be mapped to (e.g.) FORWARDER_OUTPUT_SERVERURL etc. so that the variable names can be computed automatically from the available setting names.

Let me know if this seems to make sense and lines up with what you have in mind.

coderpatros commented 3 years ago

Thanks @nblumhardt

nblumhardt commented 3 years ago

Closed in #57