datalust / seq-logging

A Node.js client for the Seq HTTP ingestion API
Apache License 2.0
25 stars 15 forks source link

Add support for handling the remote configuration ( MinimumLevelAccepted ) #23

Closed mlabrum closed 3 years ago

mlabrum commented 4 years ago

Hi All,

Thanks for accepting my previous pull request.

I really liked the idea of the feature to dynamically toggle applications log levels within Seq and noticed that the JS loggers don't have support for this yet. So I've added a callback which gets called any time the remote configuration changes.

I also added another example which sends the Seq events slower to be able to test this.

Let me know if you need me to change anything :)

Cheesier commented 3 years ago

Looking forward to this feature, anything blocking it?

larenelg commented 3 years ago

Sorry for the delay on this, looking now!

larenelg commented 3 years ago

Hi @mlabrum - apologies, it's been a while - thanks for taking the time to submit this PR.

May I ask if you're using pino-seq or bunyan-seq or something else? Do you have an example of how you plan to use the onRemoteConfigChange?

mlabrum commented 3 years ago

It's all good I know how it is with working on open source projects.

At the time I was writing this I was using https://www.npmjs.com/package/winston and wrote a custom seq logging library for it ( that I haven't open sourced yet, I was waiting for this PR... then moved onto another internal project) that when this callback is called will alter the logging level of Winston.

The idea was to introduce the functionality into the base logging library, then the community ( or myself as I use other libraries) will add support for this feature, as its one of the killer features of SEQ. ( in my opinion )

larenelg commented 3 years ago

Fantastic, thanks for that. I'll merge it in 👍

If we can help with the winston library in any way, please let us know!