Is this a new feature request?
Wanted change
The container already has an option for DELUGE_LOGLEVEL in place to set the log level. However, setting this to debug will get extremely spammy very quickly if you have a lot of active torrents.
It would be nice to get a complementary DELUGE_LOGFILE environment variable corresponding to --logfile:
-l file, --logfile=file
Output to specified logfile instead of stdout
Another option that might be welcome is --logrotate:
--logrotate[=max-size]
Enable logfile rotation, with optional maximum logfile size, default: 2M (Logfile rotation count is 5)
Reason for change
Having a logfile makes it easier to process logs later on, after shutting down the container, or simply to save the output for later upload.
Proposed code change
This is untested, but should work:
--- run 2025-04-22 19:47:24.047468461 +0200
+++ run-patched 2025-04-22 19:52:53.263299033 +0200
@@ -3,6 +3,10 @@
DELUGE_LOGLEVEL=${DELUGE_LOGLEVEL:-info}
+if [ "${DELUGE_LOGFILE}" != "" ]; then
+ DELUGE_LOGFILE = "--logfile='${DELUGE_LOGFILE}'"
+fi
+
if [[ -f /config/core.conf ]]; then
DELUGED_PORT=$(grep '"daemon_port"' /config/core.conf | tr -cd "[:digit:]")
fi
@@ -10,9 +14,9 @@
if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGED_PORT:-58846}" \
- s6-setuidgid abc /usr/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}"
+ s6-setuidgid abc /usr/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}" ${DELUGE_LOGFILE}
else
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGED_PORT:-58846}" \
- /usr/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}"
+ /usr/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}" ${DELUGE_LOGFILE}
fi
Is this a new feature request?
Wanted change
The container already has an option for
DELUGE_LOGLEVELin place to set the log level. However, setting this to debug will get extremely spammy very quickly if you have a lot of active torrents.It would be nice to get a complementary
DELUGE_LOGFILEenvironment variable corresponding to--logfile:Another option that might be welcome is
--logrotate:Reason for change
Having a logfile makes it easier to process logs later on, after shutting down the container, or simply to save the output for later upload.
Proposed code change
This is untested, but should work: