This change adds a TimedRotatingFileHandler to the already existing ftw.solr.maintenance logger, so that maintenance commands get logged to a dedicated logfile.
As discussed with @buchi and @deiferni, the log directory is determined by deriving it from the location of Zope's EventLog.
I decided to use a single logfile, solr-maintenance.log, for all processes (instances), even though this in theory could lead to concurrency issues because multiple processes might be writing to the same file.
However, I deemed this risk acceptable because
Maintenance commands will never (intentionally) be executed in parallel. So unlike the event log, this is not a file that's actively being written to most of the time.
There should not be a risk of actually losing log data (lines). The worst that could happen is hard-to-read interleaving of complete lines, from what I can tell from this article:
This change adds a
TimedRotatingFileHandler
to the already existingftw.solr.maintenance
logger, so that maintenance commands get logged to a dedicated logfile.As discussed with @buchi and @deiferni, the log directory is determined by deriving it from the location of Zope's EventLog.
I decided to use a single logfile,
solr-maintenance.log
, for all processes (instances), even though this in theory could lead to concurrency issues because multiple processes might be writing to the same file.However, I deemed this risk acceptable because
O_APPEND
mode are safely appended (don't truncate other writes)solr-maintenance-instance1.log
,solr-maintenance-instance2.log
, ... files IMHO far outweighs this risk.Jira: https://4teamwork.atlassian.net/browse/GEVER-179