On 1/3/2017 1:12 PM, Webster Homer wrote:
> We use the default log4j.properties file which rolls the log file to
> solr.log.1, solr.log.2 ... which isn't really the problem. What is
> also happening is that solr.log.1 gets renamed to
> solr_log_20170103_1110 with a timestamp as the file name. How do I
> turn off this behavior? It is not obvious in the log4j.properties file.

That rename is not done by log4j.  It is done by the bin/solr or
bin\solr.cmd script just before Solr is started.  Unlike the solr.log.N
files, those files are not subject to automatic deletion.

My best guess is that you've got a situation where something external to
Solr is restarting Solr frequently.  Solr's start script renames
solr.log to solr_log_DATE_TIME each time it starts.  As far as I am
aware, Solr does NOT have the ability to restart itself, and the CDCR
page in the reference guide doesn't mention anything about processes
being restarted as part of its operation.

Because the logfiles that you are seeing accumulate are not handled by
log4j, switching to log4j2 and adding compression will not help.  Moving
to log4j2 requires a few things to be done on the development side, and
won't be trivial.

If your system requires frequent Solr restarts for some reason, then
you're going to have to take over management of the renamed solr
logfiles as well, or edit the start script so that it doesn't rename the
main logfile.  SolrCloud does not deal well with frequent restarts, so
avoid doing them.

Thanks,
Shawn

Reply via email to