How to change the log level with a Docker container?

Continuing the discussion from Having problems with UrBackup? Please read before posting:

I am running my UrBackup server in a Docker container. How do I change the log level with that?

The image starts the server as “urbackupsrv run” without reading /etc/default/urbackupsrv, so editing LOGLEVEL there has no effect. The URBACKUP_LOGLEVEL variable in the image isn’t read by the server either. The entrypoint passes the container’s command straight to urbackupsrv, so set the container’s command/args to:

run -v debug

and recreate the container. The log is /var/log/urbackup.log inside the container. Set it back to “run” afterwards, because debug logs grow fast.

Thanks very much!

I had to consult the TrueNAS community on how to do this. The thread respondent states: “Since TrueNAS apps use Docker Compose under the hood and not a normal Docker run command you’d probably have to set the log level via environment variable.”

It should, though. Does this not work?

I have not yet tried.

Martin, what changed in the update to the TrueNAS app you delivered yesterday?

I did not change anything

But the UrBackup server app for TrueNAS changed from 1.1.10 to 1.1.11 yesterday. Who would have changed that?

Correction: uroni is right, the server does read URBACKUP_LOGLEVEL (since 2.5.37). I was looking at older code, sorry for the confusion.

So on TrueNAS you don’t need to change the command. Edit the UrBackup app, and under Additional Environment Variables add:
Name: URBACKUP_LOGLEVEL
Value: debug
Save, and the app restarts with debug logging in /var/log/urbackup.log. Set it back to warn afterwards, because debug logs grow fast.