wernight / docker-qbittorrent

Containerized qBittorrent NOX (i.e., headless)
https://registry.hub.docker.com/u/wernight/qbittorrent/
MIT License
48 stars 35 forks source link

logging #6

Open jameseck opened 7 years ago

jameseck commented 7 years ago

Hi,

Thanks for the docker image - it works beautifully. I'm running this on an openshift cluster and it's great to see someone make a docker image that doesn't require root.

One suggestion I would like to make is some consideration for logging. It would be great if this could be configured to log to stdout (docker logs).

I'm not sure of the best method of doing this, just thought I'd throw it out here. Maybe a wrapper script as pid1 that tails the log file as well as starting qbittorrent would be sufficient.

wernight commented 7 years ago

I see basic logging is on stdout, but the rest is on /home/qbittorrent/.local/share/data/qBittorrent/logs/.

Quick browsing didn't show an official way to redirect to stdout. It might be possible to redirect using a symbolic link to /dev/stdout, but it might not work as it's making .bak files.

Unless someone finds a working solution, I'd suggest to mount to cat those log files when needed (not the nicest I agree).

jameseck commented 7 years ago

Yeah I couldn't find a nice solution either. I might knock up a PR using supervisord if that's something you'd accept. It slightly breaks the one process per container model, but I don't personally stick to that when there isn't a nice way to achieve things.

wernight commented 7 years ago

I wouldn't accept a supervisord or initd on this image as it breaks its philosophy. It's worth trying doing a simple ln -s and see if it works, and possibly there is a config that avoids these backups. If not, it's always possible to send a PR to qBT to include a log to stdout CLI flag.