Friday, December 7, 2012

Add separate logs for Solr in Alfresco

How to add a separate log file for Solr Web App in Alfresco v4.0.x?

We have to separate logs of SOLR Web App from Alfresco such that, all the logs of SOLR will get store in a separate solr.log file.

1) Stop Solr tomcat.
     /var$ sudo /etc/init.d/tomcat6 stop

2) We need to create /var/alfsolr/logs directory for SOLR Web App to store all log files 
     and make it accessible to tomcat6 user.

    /var$ sudo mkdir -p /var/alfsolr/logs

   Change the ownership of directory to tomcat6 for user & group.
   /var$ sudo chown tomcat6:tomcat6 /var/alfsolr/logs

3) Add a new handler for SOLR in /var/lib/tomcat6/conf/logging.properties file.

#Adding a new handler for SOLR to the list of handlers.
handlers = 1catalina.org.apache.juli.FileHandler, . . . , 3localhost.org.apache.juli.FileHandler

# Handler specific properties.
3localhost.org.apache.juli.FileHandler.level = FINE
3localhost.org.apache.juli.FileHandler.directory = /var/alfsolr/logs
3localhost.org.apache.juli.FileHandler.prefix = solr.

#Set logger level
org.apache.solr.level=INFO
org.apache.solr.handlers=3localhost.org.apache.juli.FileHandler

Change the ownership of file to tomcat6 for user & group.
/var$ sudo chown tomcat6:tomcat6 /var/lib/tomcat6/conf/logging.properties

4) Start Solr tomcat.
     /var$ sudo /etc/init.d/tomcat6 start

5) Check the log file (solr.YYYY-MM-DD.log) created under /var/alfsolr/logs/ directory.
    /var$ tail -100f /var/alfsolr/logs/solr.2012-12-05.log

INFO: Deploying configuration descriptor solr.xml
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
locateSolrHome
INFO: Using JNDI solr.home: /var/alfsolr
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
INFO: Solr home set to '/var/alfsolr/'
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
replaceClassLoader
INFO: Adding 'file:/var/alfsolr/lib/commons-collections-3.1.jar' to
classloader
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
replaceClassLoader
INFO: Adding 'file:/var/alfsolr/lib/antlr-3.3-complete.jar' to
classloader
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
replaceClassLoader
INFO: Adding 'file:/var/alfsolr/lib/saxpath.jar' to classloader
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
replaceClassLoader
INFO: Adding 'file:/var/alfsolr/lib/chemistry-opencmis-test-tck-
0.6.0.jar' to classloader
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
replaceClassLoader
INFO: Adding 'file:/var/alfsolr/lib/tika-parsers-1.1-20111128.jar' to
classloader
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
replaceClassLoader
INFO: Adding 'file:/var/alfsolr/lib/hibernate-3.2.6-patched.jar' to
classloader
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
replaceClassLoader
INFO: Adding 'file:/var/alfsolr/lib/chemistry-opencmis-client-bindings-
0.6.0.jar' to classloader
Dec 5, 2012 6:10:34 PM org.apache.solr.core.SolrResourceLoader
replaceClassLoader
INFO: Adding 'file:/var/alfsolr/lib/lucene-analyzers-2.4.1.jar' to
classloader



No comments:

Post a Comment