On 8/11/2015 3:10 AM, Adrian Liew wrote: > Hi Erick, > > 1> how did you install/run your Solr? As a service or "regular"? See > the reference guide, "Permanent Logging Settings" for some info on the > difference there. > > What is the difference between "regular" or "service"?
On certain operating systems, you can use a shell script that comes with Solr 5.x to install Solr as a service, with an init script to start it on boot. "Regular" would mean manual start using the bin/solr script. > 2> what does your log4j.properties file look like? > > Here are the contents in the log4j.properties file: > > # Logging level > solr.log=logs > log4j.rootLogger=INFO, file, CONSOLE > > log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender > > log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout > log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x > [%X{collection} %X{shard} %X{replica} %X{core}] \u2013 %m%n > > #- size rotation with log cleanup. > log4j.appender.file=org.apache.log4j.RollingFileAppender > log4j.appender.file.MaxFileSize=4MB > log4j.appender.file.MaxBackupIndex=9 > > #- File to log to and log format > #log4j.appender.file.File=${solr.log}/solr.log > log4j.appender.file.File=C:/solr_logs/solr.log > log4j.appender.file.layout=org.apache.log4j.PatternLayout > log4j.appender.file.layout.ConversionPattern=%-5p - %d{yyyy-MM-dd > HH:mm:ss.SSS}; [%X{collection} %X{shard} %X{replica} %X{core}] %C; %m\n > > log4j.logger.org.apache.zookeeper=WARN > log4j.logger.org.apache.hadoop=WARN > > # set to INFO to enable infostream log messages > log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF > > I am not sure how best I can limit the size of the solr_logs directory. Does > log4j come with a feature to remove old log files with a given retention > period? The section of the log4j.properties file entitled "size rotation with log cleanup" describes the built-in rotation for the solr log. It will keep nine backup logfiles, and each one will be limited in size to 4MB. That means that the maximum size of the logs for *solr* is about 40MB. If you aren't seeing this behavior, then there are a few possible problems. Your properties file may have a bug in it. It looks correct to me, but I haven't tried to actually validate it. It might not be Solr (log4j) that's making the problem logfiles. It could be Jetty, or something else entirely. Your Java VM might not be using the properties file that you included here. Thanks, Shawn