-
Notifications
You must be signed in to change notification settings - Fork 676
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
Use different log levels for different loggers #1126
Comments
I think this is possible although this may require some tweakering of your configuration. For example, I see that you calling Which kind of For example, if you want to log to the console with filtering_dict = {
"": "INFO",
"uvicorn": "WARNING",
"fastapi": "WARNING",
}
logger.add(sys.stderr, filter=filtering_dict) |
Hey! Thanks for your reply! Sorry, I am a bit busy atm. I will try out your posted filter and provide more information once I visit that topic again. Hopefully within the next few weeks. |
Hi!
I wanted to try out loguru instead of the standard logging. However, I have one issue where I kinda find no solution to it.
My main issue is that I have multiple loggers. I use one for my application and two more for libraries (like
logging.getLogger("uvicorn.access")
). My main application logs onINFO
, while for the libraries I useWARNING
.So for example currently I have
uvicorn
logs are withWARNING
to console andINFO
to uvicorn.logsI tried with loguru something like
but thats obviously not possible.
So basically I want to have different log levels on different loggers. I tried the
filter
but couldn't make it work. I either get no logs or all logs in all files.In addition I would also like to be able to:
extra
/format
for each application/libraryIs this in general possible with loguru?
The text was updated successfully, but these errors were encountered: