I'm running an instance of Apache Solr with Tomcat 6. The scripts I used for installing configured Tomcat to log "everything" which means that it generates huge logfiles because every query etc. is being logged. The log file that is growing fast is "catalina.out".
I tried to set the logging level to WARNING by changing these lines in logging.properties
1catalina.org.apache.juli.FileHandler.level = INFO
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
to
1catalina.org.apache.juli.FileHandler.level = WARNING
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
After restarting Tomcat, my log still contains mostly INFO messages. The next thing I tried was to uncomment an example configuration setting the catalina logging level to WARNING:
# For example, to log debug messages in ContextConfig and HostConfig
# classes and to log only warnings and errors in other
# org.apache.catalina.** classes, uncomment these lines:
org.apache.catalina.level = WARNING
Unfortunately, after restarting Tomcat, I still got mostly INFO messages in catalina.out. How can I set logging to log only WARNING entries?
To make you see what I'm talking about, here is a small excerpt of the log:
413222 [http-127.0.0.1-8080-1] INFO org.apache.solr.core.SolrCore – [german] webapp=/solr path=/select params={hl.fragsize=100&spellcheck=true&enableElevation=false&facet=true&facet.mincount=0&spellcheck.maxCollationTries=0&qf=content^40.0+title^5.0+keywords^2.0+tagsH1^5.0+tagsH2H3^3.0+tagsH4H5H6^2.0+tagsInline&hl.simple.pre=<span+class%3D"results-highlight">&q.alt=*:*&json.nl=map&hl.fl=content&wt=json&spellcheck.collate=true&hl=true&rows=10&echoParams=all&debugQuery=true&fl=*,score&bq=(type:tx_useruniluaddress_domain_model_address)^10&start=0&facet.sort=count&q=Charles+B.+Blankart&hl.simple.post=</span>&facet.field=type&fq=siteHash:"e1d2852464cb2a7272d6f8d89e8803a91e22d96e"&fq={!typo3access}-1,0} hits=54 status=0 QTime=469
422236 [autoExpireDocs-13-thread-1] INFO org.apache.solr.update.processor.DocExpirationUpdateProcessorFactory – Begining periodic deletion of expired docs
422240 [autoExpireDocs-13-thread-1] INFO org.apache.solr.update.UpdateHandler – start commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=true,prepareCommit=false}
422240 [autoExpireDocs-13-thread-1] INFO org.apache.solr.core.SolrCore – SolrIndexSearcher has not changed - not re-opening: org.apache.solr.search.SolrIndexSearcher
422241 [autoExpireDocs-13-thread-1] INFO org.apache.solr.update.UpdateHandler – end_commit_flush
Best Answer
I finally found out that is was as easy as open the Solr admin panel and go to Logging -> Level in the side navigation. There you can set the logging level to WARNING.
This only sets the logging level for the current run of Solr. As soon as Solr is restarted, this is reset to the configured setting.
The setting can be configured in file
tomcat/lib/log4j.properties
where all the logging settings can be overridden, e.g.More information on logging can be found here.