开发者

How to deploy the same webapp with different logging? (Tomcat, Solr)

开发者 https://www.devze.com 2023-01-03 08:51 出处:网络
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 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


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/


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号