How to change log level? #2162

Closed
opened 2025-10-09 17:48:26 +03:00 by OVERLORD · 13 comments
Owner

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

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
OVERLORD added the question label 2025-10-09 17:48:26 +03:00
Author
Owner

@mprasil commented on GitHub:

Hi, you should be able to do this by setting EXTENDED_LOGGING to false.

@mprasil commented on GitHub: Hi, you should be able to do this by setting `EXTENDED_LOGGING` to false.
Author
Owner

@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: Thank you, it helped. It works now as expected. This should be documented here: https://github.com/dani-garcia/bitwarden_rs/wiki/Logging
Author
Owner

@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)
...

@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)` `...`
Author
Owner

@dani-garcia commented on GitHub:

You'll need to use both, in this case:

ROCKET_LOG=critical
EXTENDED_LOGGING=false

At the moment the extended logging needs to be disabled because it hardcodes the debug level, in the future we should change that.

@dani-garcia commented on GitHub: You'll need to use both, in this case: ```sh ROCKET_LOG=critical EXTENDED_LOGGING=false ``` At the moment the extended logging needs to be disabled because it hardcodes the debug level, in the future we should change that.
Author
Owner

@mprasil commented on GitHub:

You can edit the page and add that if you have some time. 😉

@mprasil commented on GitHub: You can edit the page and add that if you have some time. 😉
Author
Owner

@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.

@jstirling commented on GitHub: Seems to have hit the spot. Thanks for the quick reply before my log exploded :yum: Would suggest updating the wiki with that as well.
Author
Owner

@0xERR0R commented on GitHub:

I added the "Change the log level" section to the page, please review

@0xERR0R commented on GitHub: I added the "Change the log level" section to the page, please review
Author
Owner

@dani-garcia commented on GitHub:

This was implemented a couple of weeks ago, check the .env template:
253faaf023/.env.template (L46-L50)

@dani-garcia commented on GitHub: This was implemented a couple of weeks ago, check the .env template: https://github.com/dani-garcia/bitwarden_rs/blob/253faaf02372ec0ce198e2ee480de4a59986d8a6/.env.template#L46-L50
Author
Owner

@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.

@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.
Author
Owner

@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.

@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.
Author
Owner

@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: Thanks. That seems to be working. May want to updated the Logging documentation, as it says to use ROCKET_LOG instead of LOG_LEVEL.
Author
Owner

@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?

@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?
Author
Owner

@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)

@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)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#2162