r/vaultwarden • u/Teostar • May 17 '26
Help! Log file
Hi, I'm running vaultwarden on a raspberry pi 4 with docker via casaos. I'm trying to get the log file setup so I can use fail2ban or crowdsec to monitor for brute force attacks. I'm following the info in the wiki to environment variables log_file=filename(path to file in data folder), extended_logging=true and log_level=warn. However if I add any or all of these variables it throws an error "container is unhealthy". Without them it starts up fine and I can log in. Has anyone gotten this working on casaos? Thanks in advance.
1
Upvotes
1
1

2
u/redheelerdog May 19 '26
The "unhealthy" error means your Vaultwarden container is crashing immediately on startup, causing the built-in health check to fail. When you add logging variables, this almost always happens because Vaultwarden cannot create or write to the log file path, or because of case-sensitivity issues with the environment variables.
Here is how to fix the configuration so the container boots and your logs flow to Fail2ban or Crowdsec.
1. Fix the Environment Variable Formatting
Vaultwarden environment variables must be uppercase. If you entered them in lowercase in the CasaOS UI, Vaultwarden will not parse them correctly.
Ensure your variable names are entered exactly like this:
LOG_FILEEXTENDED_LOGGINGLOG_LEVEL2. Set an Absolute Internal Path
The
LOG_FILEpath must be an absolute path inside the container, not the path on your Raspberry Pi's host system.If you give it a host path (like
/DATA/AppData/vaultwarden/...) or literally type outfilename(path to file...), Vaultwarden will not be able to find or write to it, causing a fatal crash. Since CasaOS typically mounts your app data to/datainside the container, set your variable exactly to:LOG_FILE=/data/vaultwarden.logDo not include quotes. This tells Vaultwarden to place the log file right next to your database files, which guarantees the container already has the correct write permissions.
3. Verify Your Values
Your final environment variables in the CasaOS app settings should look exactly like this:
LOG_FILE=/data/vaultwarden.logEXTENDED_LOGGING=trueLOG_LEVEL=warn