mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-10 17:23:04 +03:00
How to change log level? #2162
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @0xERR0R on GitHub.
Bitwarden_rs docker container logs each http request with "INFO" message. How can I change the log level to "critical" to avoid these messages. I just want to have only errors in docker log.
I tried to set the environment variable "ROCKET_LOG" to "critical", but the info messages are still there.
Thank you in advance
@mprasil commented on GitHub:
Hi, you should be able to do this by setting
EXTENDED_LOGGINGto false.@0xERR0R commented on GitHub:
Thank you, it helped. It works now as expected. This should be documented here: https://github.com/dani-garcia/bitwarden_rs/wiki/Logging
@0xERR0R commented on GitHub:
I tried it, it looks different (without log level entry), but I still see entries like
GET /api/sync application/json:=> Matched: GET /api/sync?<data..> (sync)...@dani-garcia commented on GitHub:
You'll need to use both, in this case:
At the moment the extended logging needs to be disabled because it hardcodes the debug level, in the future we should change that.
@mprasil commented on GitHub:
You can edit the page and add that if you have some time. 😉
@jstirling commented on GitHub:
Seems to have hit the spot. Thanks for the quick reply before my log exploded 😋
Would suggest updating the wiki with that as well.
@0xERR0R commented on GitHub:
I added the "Change the log level" section to the page, please review
@dani-garcia commented on GitHub:
This was implemented a couple of weeks ago, check the .env template:
253faaf023/.env.template (L46-L50)@mprasil commented on GitHub:
That is perfect, thanks a lot for this @0xERR0R. I'm going to close this now as it seems the question has been answered and documentation is up to date.
@jstirling commented on GitHub:
I don't think this is a valid solution to the issue. With extended_logging set to false, you no longer receive failed login errors. Which in turn means Fail2Ban won't work.
@emorgoch commented on GitHub:
Thanks. That seems to be working. May want to updated the Logging documentation, as it says to use ROCKET_LOG instead of LOG_LEVEL.
@emorgoch commented on GitHub:
So I'm not sure I'm getting this. I've updated my docker (running on unraid) to set ROCKET_LOG=critical, and EXTENDED_LOGGING=false. However, now I'm not getting any logs.
What should be the correct parameters to get just errors (and warnings if needed), as that's what failed login attempts show up as?
@dani-garcia commented on GitHub:
You can use LOG_LEVEL=warn, but that requires EXTENDED_LOGGING=true. (The available errors are https://docs.rs/log/0.4.7/log/enum.Level.html#variants)