4

We are using multiple solr instances on tomcat but want that they log into different log files. How could we do this?

We are using the follwing xml file under tomcat/conf/Catalina/localhost to make it working:

<Context docBase="/pathtosolr/dist/apache-solr-1.4.0.war" debug="0" crossContext="true" >
   <Environment name="solr/home" type="java.lang.String" value="/pathtosolr/solr" override="true" />
</Context>

Update: From Jems answer I found this documentation:

Tomcat offers a choice between settings for all applications or settings specifically for the Solr application.

To change logging settings for Solr only, edit tomcat/webapps/solr/WEB-INF/classes/logging.properties. You will need to create the classes directory and the logging.properties file. You can set levels from FINEST to SEVERE for a class or an entire package. Here are a couple of examples:

org.apache.commons.digester.Digester.level = FINEST

org.apache.solr.level = WARNING

Alternately, if you wish to change Tomcat’s JDK Logging API settings for every application in this instance of Tomcat, edit tomcat/conf/logging.properties.

See the documentation for the SLF4J Logging API for more information:

http://slf4j.org/docs.html

Karussell
  • 17,085
  • 16
  • 97
  • 197

2 Answers2

3

You might wanna take a look at this page: http://globalgateway.wordpress.com/2010/01/06/configuring-solr-1-4-logging-with-log4j-in-tomcat/

Jem
  • 551
  • 3
  • 2
0

There seems to be no good solution:

2008 and 2010

except repacking the solr.war file with a different logging configuration file.

Update: see accepted answer!

Karussell
  • 17,085
  • 16
  • 97
  • 197