Bitwarden_rs: How to change log level?

Created on 8 Mar 2019  路  13Comments  路  Source: dani-garcia/bitwarden_rs

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

question

All 13 comments

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

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

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.

Thank you, it helped. It works now as expected. This should be documented here: https://github.com/dani-garcia/bitwarden_rs/wiki/Logging

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

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

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.

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.

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

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.

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?

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)

Thanks. That seems to be working. May want to updated the Logging documentation, as it says to use ROCKET_LOG instead of LOG_LEVEL.

Was this page helpful?
0 / 5 - 0 ratings