This guide applies to Solr 4 only!
For Solr 8 deployments please refer to the Apache guide: https://solr.apache.org/guide/8_11/configuring-logging.html or the Guide - Deployment Solr Cloud Server respectively.
This describes samples for configuring logging in the different possible Solr 4 deployments for development.
Production setups may need additional considerations.
Installed a plain tomcat and added the deployed the solr webapp on it.
There is a configuration file that configures the overall tomcat logging.
Add 5solr.org.apache.juli.FileHandler
to handlers. define the 5solr.org.apache.juli.FileHandler.* log properties add level and handler to log:
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, \ 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, \ java.util.logging.ConsoleHandler, 5solr.org.apache.juli.FileHandler 5solr.org.apache.juli.FileHandler.level = FINE 5solr.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 5solr.org.apache.juli.FileHandler.prefix = solr. org.apache.solr.level = INFO org.apache.solr.handlers=5solr.org.apache.juli.FileHandler
Apache Tomcat Logging: http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Java_logging_API_%E2%80%94_java.util.logging
Place a logging.properties into WEB-INF/classes:
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler org.apache.juli.FileHandler.level = FINE org.apache.juli.FileHandler.directory = ${catalina.base}/logs org.apache.juli.FileHandler.prefix = solr. java.util.logging.ConsoleHandler.level = FINE java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
E.g., when adding a context file to:
\engine\tomcat\servers\appserver0\conf\Catalina\localhost
or
copying the solr.war to:
\engine\tomcat\servers\appserver0\webapps
Note
Only recommended for development.
The Intershop logging framework provides an adapter to catch all javalogging (specified in share/system/config/cluster/logging.properties with the intershop.logging.javaloggingadapter.enable
)
By default the INFO level is logged nowhere. To enable INFO logging for the solr log messages, e.g., to log it into console add org.apache.solr to TraceConsole appender via SMC or add:
intershop.logging.appender.TraceConsole.categories=org.apache.solr
To share/system/config/cluster/logging.properties
To create a log file for the solr log messages:
Copy the logback-solr.xml to share/systemconfig/cluster/loggingextension and add the line:
intershop.logging.additionalfiles.cluster=logback-solr.xml
To share/system/config/cluster/logging.properties
This creates a log file in \share\system\log\solr-127.0.0.1-ES1-appserver0.log with all log messages that origin from org.apache.solr.
See also: Concept - Logging (valid to 7.3)
When using the startup from the solr distribution (It is a jetty servlet container delivered in the solr distribution).