-
1. Re: Logging configurations
prasad.deshpande Aug 19, 2011 9:32 AM (in response to max010)You need to create a handler first somethig like this
<periodic-rotating-file-handler name="SOLRFILE" autoflush="true"> <level name="DEBUG"/> <formatter> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/> </formatter> <file relative-to="jboss.server.log.dir" path="solr.log"/> <suffix value=".yyyy-MM-dd"/> <append value="true"/> </periodic-rotating-file-handler> and a logger like
<logger category="org.apache.solr"> <level name="INFO"/> <handlers> <handler name="SOLRFILE"/> </handlers> </logger> This will create file solr.log in the log directory. Also, it as the date changes, it will add suffix yyyy-MM-dd to the file. So file solr.log will always be for current date.
-
2. Re: Logging configurations
max010 Aug 23, 2011 9:43 PM (in response to prasad.deshpande)Thanks Prasad,
I have created the handler and logger as you said but I still do not get a solr.log file.
In the server.log I get the following warnings:
01:06:27,313 ERROR [stderr] (MSC service thread 1-1) log4j:WARN No appenders could be found for logger (org.apache.solr.core.SolrResourceLoader).
01:06:27,313 ERROR [stderr] (MSC service thread 1-1) log4j:WARN Please initialize the log4j system properly.
01:06:27,314 ERROR [stderr] (MSC service thread 1-1) log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
The jars I have in the WEB-INF/lib used for logging are:
log4j-1.2.16.jar
jcl-over-slf4j-1.6.1.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
I am not quite sure what I am missing.
Any suggestions?
-
3. Re: Logging configurations
jaikiran Aug 23, 2011 11:40 PM (in response to max010)So you are using log4j and not JBoss logging. You will have to create a log4j.xml file with the solr appenders/loggers in that file and package the log4j.xml in your application (.war/WEB-INF/classes folder)
-
4. Re: Logging configurations
prasad.deshpande Aug 24, 2011 4:48 AM (in response to max010)As Jaikiran suggested, also have a look at this thread. http://community.jboss.org/thread/171288?tstart=0
-
5. Re: Logging configurations
max010 Aug 24, 2011 8:05 PM (in response to prasad.deshpande)I have added a log4j.properties in the solr.war/WEB-INF/classes directory and I got a solr.log.
The log4j.properties looks like this:
log4j.rootLogger=INFO, SOLR
log4j.appender.SOLR=org.apache.log4j.DailyRollingFileAppender
log4j.appender.SOLR.file=/opt/jboss-as-web-7.0.0.Final/standalone/log/solr.log
log4j.appender.SOLR.datePattern='.'yyyy-MM-dd
log4j.appender.SOLR.layout=org.apache.log4j.PatternLayout
log4j.appender.SOLR.layout.conversionPattern=%d %p [%c{3}] - [%t] - %X{ip}: %m%n
Thanks everyone.