papertrail / remote_syslog2

To install, see "Releases" tab. Self-contained daemon for reading local files and emitting remote syslog (without using local syslogd).
http://help.papertrailapp.com/
MIT License
637 stars 157 forks source link

Add support for multiple logging destinations #244

Closed aenbacka closed 1 year ago

aenbacka commented 2 years ago

This pull request adds support for (optionally) logging to multiple syslog destinations.

The optional destinations need to be defined in the configuration file, e.g.,

destination: host: some_host port: 12345 protocol: tls token: some_token destination1: host: some_host2 port: 67890 protocol: tls token: some_token destination2: ...

The implementation supports optional destinations indexed from 1 to maxDestinationIndex (currently max 10 optional destinations).

The change is fully backwards-compatible, i.e., we always process the 'destination' config element (and the command-line destination parameter overrides the config file 'destination', as previously).

Also update the tests to use the new internal format.

scalp42 commented 2 years ago

Would it not make more sense to just have a new destinations field and mention that destination takes over to keep it backward compatible as well? Curious to know what are your thoughts.

aenbacka commented 2 years ago

@scalp42 This was the first approach I came up with, could you give some example on how the suggested field would be used?