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

Way to change loglevel locally / globally? #748

Open
windymelt opened this issue Apr 29, 2023 · 1 comment
Open

Way to change loglevel locally / globally? #748

windymelt opened this issue Apr 29, 2023 · 1 comment

Comments

@windymelt
Copy link

It may be useful if we can change loglevel in scope like: logger.withLoglevel("DEBUG"). Defining it as IO[Resource[IO, Unit]] enables us to change and revert loglevel simply.

Currently I'm calling System.setProperty("org.slf4j.simpleLogger.log.FooClass","DEBUG").

Thanks.

@rossabaker
Copy link
Member

I don't know that this is fits in log4cats. That implementation configures the slf4j-simple backend, which is not anything log4cats knows about. It only integrates slf4j-api, which doesn't have a generic way to send this signal to its backends.

A module that does this for a specific backend should work fine, but we wouldn't want to tie log4cats' release cycle to any slf4j implementation, so it would have to live in another repo. We could link to it as a related project.

I'm unsure why it would need to be IO[Resource[IO, Unit]] instead of Resource[IO, Unit].

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