On 10/13/2012 3:43 AM, Shawn Heisey wrote:
The problem that I am having is with the -excl-slf4j.war file, which I am trying to use in order to use log4j instead of jdk logging. When I do that, it seems to be unable to find the sharedLib folder in solr.xml. Because it can't find any slf4j bindings at all, I cannot see what's going on in the log. Entire log included:

2012-10-13 02:21:52.972:INFO:oejs.Server:jetty-8.1.2.v20120308
2012-10-13 02:21:52.988:INFO:oejs.NCSARequestLog:Opened /opt/solr4/logs/request.2012_21_13.log 2012-10-13 02:21:52.992:INFO:oejdp.ScanningAppProvider:Deployment monitor /opt/solr4/contexts at interval 0 2012-10-13 02:21:52.995:INFO:oejd.DeploymentManager:Deployable added: /opt/solr4/contexts/solr.xml 2012-10-13 02:21:53.710:INFO:oejw.StandardDescriptorProcessor:NO JSP Support for /solr, did not find org.apache.jasper.servlet.JspServlet 2012-10-13 02:21:53.732:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/solr,file:/opt/solr4/solr-webapp/webapp/},/opt/solr4/webapps/solr.war 2012-10-13 02:21:53.732:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/solr,file:/opt/solr4/solr-webapp/webapp/},/opt/solr4/webapps/solr.war
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

I also tried putting the slf4j jars in /opt/solr4/lib (jetty's lib directory). Unsurprisingly, there was no change. Where can I put the jars to make this work, and how to I tell jetty/solr where to find them? I would very much like to avoid having to specify individual jars on the java commandline, because of the upgrade pain that will cause.

As an interim measure, I tried putting the jars in a separate directory and added a commandline option for the classpath. I also downgraded to 1.6.4, because despite asking for a war without it, the war still contains slf4j-api version 1.6.4. The log still shows that it failed to find a logger binding - no difference from above.

java -classpath libsolr/log4j-1.2.17.jar:libsolr/slf4j-log4j12-1.6.4.jar -jar start.jar

In other news, I finally got jetty to pay attention to my logging.properties file for jdk logging, but I had to do it with a -Djava.util.logging.config.file=etc/logging.properties option. Trying to set that property in jetty.xml according to the wiki didn't work. I notice that the example says 'mortbay' ... perhaps Jetty 8 does it differently?

http://wiki.apache.org/solr/LoggingInDefaultJettySetup

I would really prefer to use log4j ... can anyone tell me how I can go about doing this successfully?

Thanks,
Shawn

Reply via email to