Repository navigation
logs: Add AccessLog and RuntimeLog options for the log files - #235
Conversation
|
LGTM |
b2a6a8c to
a0692ab
Compare
|
rebase / force push on top of master @elboulangero |
|
Why name the option
|
a0692ab to
fb5d67e
Compare
I think it's to be close to what Nginx does. I have renamed it to RuntimeLog + Update PR description |
The download log is always named downloads.log in LogDir, and the runtime log can only be redirected to a file with the -log flag of the daemon, which means changing how mirrorbits is started. Add two options: - AccessLog: the access log (downloads and HEAD requests), "downloads.log" by default so existing setups are unchanged. An empty value disables it. - RuntimeLog: the runtime log, empty by default to keep logging on stderr. The -log flag still takes precedence. Relative names are created in LogDir, absolute paths are used as is, so for example the access log can be sent to /dev/null while the runtime log goes to a file. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
fb5d67e to
0b6475f
Compare
I've seen the parallel with web servers, but web servers really log errors in their error.log, it's quite different here (it's really a lot of informational messages that go through) |
|
Thanks very much @clementperon ! I've looked at the changes and it looks good, happy with it. Thanks again. |
Today the download log is always
downloads.loginLogDir, and the runtime log can only go to a file through the daemon's-logflag. This adds two options:AccessLogdownloads.logRuntimeLog-logstill takes precedence.Relative names are created in
LogDir, absolute paths are used as is. So the defaults behave exactly like today, and a setup can for example send the access log to/dev/nullwhile keeping the runtime log inLogDir:Context: Team Kodi runs mirrors.kodi.tv with that kind of configuration (named
ErrorLogthere), through a patch in its fork (xbmc/mirrorbits@621f3bb). That patch renamed the default download log and joined absolute paths ontoLogDir; this version keeps upstream's default and handles absolute paths.Tests: new
TestLogFilePathscovers relative and absolute names,-logprecedence, and disabling the access log;make testpasses forlogs(also with-race).http/TestMirrorHandler3xxfails the same way on master without this change.🤖 Generated with Claude Code