Question

I have a Java app that uses the Apache Commons Logging library to log various debug messages, errors, etc. It is currently set up to log to the console.

This is all working fine, but when I include Apache Tika on the classpath (as required by a different part of the application), the logging suddenly stops working. I've tried things like rearranging the classpath order, but nothing seems to help.

Log4J is being used to do the logging, and the properties file is set up correctly (it works without Tika). Getting the console to show the Log4J debug messages shows that, both before and after I add Tika, it is finding the properties file.

Any ideas what might be causing this - and more importantly, how I can fix it?

Was it helpful?

Solution

I guess Log4j is using a different configuration file found on the classpath. Try running your application with -Dlog4j.debug

If your application runs in Tomcat you could add it to:

export TOMCAT_OPTS="-Dlog4j.debug -Dlog4j.configuration=foobar.xml"

Running it with debug will show you where log4j finds it configuration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top