views:

65

answers:

2

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

A: 

There seems to be no good solution:

2008 and 2010

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

Karussell
+1  A: 

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
thanks for your suggestion! but what will happen to the logfile if I reload solr? will it be deleted?
Karussell
No, it will not be deleted.
Jem
nice! also take a look here: http://www.lucidimagination.com/search/document/CDRG_ch09_9.4.2.1
Karussell