Solr is a great piece of software but its logging is bloody annoying. Defaultwise on my Tomcat, it will write all its log messages to the system out log, which is a pain in the but to say the least.
To make it log to its own log file, this is what I did to tomcat/conf/logging.properties
# added 6localhost.org.apache.juli.FileHandler to the list of handlers 6localhost.org.apache.juli.FileHandler.level = FINE 6localhost.org.apache.juli.FileHandler.directory = /var/log/escenic 6localhost.org.apache.juli.FileHandler.prefix = solr. org.apache.solr.level=INFO org.apache.solr.handlers=6localhost.org.apache.juli.FileHandler
Now, I get all solr messages in /var/log/escenic/solr-2009-07-22.log
. What a relief! Of course, you may want to drop the logging level to WARNING
Thank you ! I was desesperate to make solr logging work, you saved my day.
I have lines just like those in my logging.properties file, but the logs still go catalina.out. Did you configure Solr in any way to make the logs behave?
I agree, I really like Solr but I’m ready to beat my head against my desk trying to figure out its logging.
Yes, the above lines of configuration doesn’t work.
Why those java products is always makes someone else’s head crackJ!!
That’s not just logic. That’s really seslbine.
thanks and this worked as mentioned.
For people it did not work, please make sure u put the handler in the list of handlers in the line,
handlers = 1catalina.org.apache.juli.FileHandler, ……
also make sure ur log output directory is right..
6localhost.org.apache.juli.FileHandler.directory = /var/log/escenic -> poin it to where ur other logs are.
Thanks for that, copy, paste & it works. As Veena already mentioned, the new handler needs to be added to the list of available handlers, adding this information to your initial post could prevent some headache for some people ;-))
Cheers mate!
Thanks a lot..saves so much time..
Thanks it worked for me.
September 19, 2006>I use 5 sources as my CP. They never see the first draft, but do read the first edited draft. The first time around it is hard to get them into honesty mode, but after they understand that you wo8;7n21#&y hate them for being honest, things turn around.
Excellent Help.. It works great đŸ™‚
[…] 7. To set up Solr logging in its own file (use /var/log/solr), follow these instructions: (https://skybert.wordpress.com/2009/07/22/how-to-get-solr-to-log-to-a-log-file/) […]