Skip to content

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

Merged
larenelg merged 2 commits into
datalust:devfrom
mlabrum:feature/add-dynamic-log-level
Dec 3, 2020
Merged

Add support for handling the remote configuration ( MinimumLevelAccepted )#23
larenelg merged 2 commits into
datalust:devfrom
mlabrum:feature/add-dynamic-log-level

Conversation

@mlabrum

@mlabrum mlabrum commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

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

Cheesier commented Dec 1, 2020

Copy link
Copy Markdown

Looking forward to this feature, anything blocking it?

@larenelg

larenelg commented Dec 2, 2020

Copy link
Copy Markdown
Contributor

Sorry for the delay on this, looking now!

Comment thread example/example_async.js Outdated
.then(() => seq.close());

async function sayHello(times) {
n = n + 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n is not declared yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed :)

@larenelg

larenelg commented Dec 3, 2020

Copy link
Copy Markdown
Contributor

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

mlabrum commented Dec 3, 2020

Copy link
Copy Markdown
Contributor Author

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
larenelg merged commit 1e28223 into datalust:dev Dec 3, 2020
@larenelg

larenelg commented Dec 3, 2020

Copy link
Copy Markdown
Contributor

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

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

@cheng93 cheng93 mentioned this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants