Skip to content

Restrict/Filter logs by namespace and level #174

Closed Answered by AJStacy
tiagobnobrega asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @tiagobnobrega, great question.

If you take a look at the documentation for the seal() modifier, you should see that it accepts a UserConfiguration value as a parameter (https://adzejs.com/reference/terminators.html#seal). Also, if you take a look at the UserConfiguration documentation, you should see that it accepts an activeLevel property (https://adzejs.com/reference/configuration.html#user-configuration).

So, instead of setting global configuration with the setup() function, rather provide specific configurations to each child logger in the seal() terminator.

export const logA = adze.namespace('nsA').seal({ activeLevel: 'debug' });
export const logB = adze.namespace('nsB').seal({ a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AJStacy
Comment options

Answer selected by tiagobnobrega
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants