2

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
  • The option you set applies to catalina, but not to solr, as it says. I don't know what the right option is. However, my recommendation is to ditch the application and write it in something other than java ;) – Falcon Momot Aug 20 '14 at 9:04
  • Thanks for your comment, but it's not very useful to advice me to write an own search application instead of going with a widely adpoted application. – lorenz Aug 20 '14 at 12:30
  • See stackoverflow.com/questions/5072464/… – jas_raj Aug 22 '14 at 9:27
  • Removed or rename off logging.properties and see what happens. Most likely it's the log4j logger you need to configure. See above link. – Schrute Aug 24 '14 at 16:25
2

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.

# Disables the TransactionLog
log4j.logger.org.apache.solr.update.TransactionLog=OFF
# Sets the general logging threshold to WARN
log4j.logger.org.apache.solr=WARN

More information on logging can be found here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.