Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding category without default #1380

Open
devashishg opened this issue Mar 9, 2023 · 2 comments
Open

adding category without default #1380

devashishg opened this issue Mar 9, 2023 · 2 comments

Comments

@devashishg
Copy link

I have one logger initialised with a file appender in default category. I need to add a new logger category with different file appender in same code base for different module.
but when I tried configuring new category, I have to pass default appender.

is there a way to fetch the default configuration from the logger or any way to add new category with different file appender.

@lamweili
Copy link
Contributor

At the moment, I don't think there is a way to fetch the configurations. While I can possibly cache the passed-in configuration and return that, it would not reflect any programmatical changes (via Logger) as they don't go through the same flow.

For a quick solution, I would recommend caching your configuration, amending it and calling log4js.configure() every time you want it to get updated. Would that suffice?

@devashishg
Copy link
Author

We can have this as a feature, we can amend the configurations and add new category.

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

No branches or pull requests

2 participants