Some time ago I had the problem, that Log4j-logging didn’t work
on our java-based web application, fueled by Tomcat and running on a solaris server.
First thing that came to my mind: where in our abundant archive of JARs
is a log4j configuration file (normally log4j.properties or log4j.xml).
Second thing: where is that log4j configuration file referenced?
Or in broader terms:
a) How do I find a certain file in a big bunch of JARs?
b) How do I find text (and the file containing it) in a certain jar?
Solaris and Linux systems contain the Bourne Again Shell, or short:
BASH, which enables some basic programming, that I could use to solve my
problem.
a) find . -name *.jar -exec grep -l log4j.properties {} \;
b) zipgrep log4j.properties ./JarContainingFileLog4jProperties/some.jar
So I found the evil JAR, which was resetting my log4j configuration:
it was Cocoon. Once I changed the Cocoon configuration in regards
to Log4j, everything was ok again. Log4j was working like a charm again.