views:

284

answers:

5

I have a huge ear that uses log4j and there is a single config file that is used to set it up. In this config file there is no mention of certain log files but, additional files apart from those specified in the config file get generated in the logs folder. I've searched for other combinations of (logger|log4j|log).(properties|xml) and haven't found anything promising in all of the jar files included in the ear. How do I track down which is the offending thread/class that is creating these extra files?

A: 

Have you tried looking in your app server config? In JBoss, look in %JBOSS_HOME%/server/%INSTANCE_DIR%/conf/jboss-log4j.xml.

sblundy
definitely not from the appserver configuration as the config file is loaded separately and the logs dir is nowhere near the appservers default log dir
shyam
A: 

Formally SysInternal's, now Microsoft's Process Explorer http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

"Find" menu item -> "Find Handle or DLL..."

Adam Caviness
Already tried that :( But, when I search from the appserver's java process all files and directories I see are of those of the appserver itself my log directory doesn't figure in those. btw i'm using WAS 6.1. But, I plan to take a deeper look into procexp
shyam
A: 

SysInternals may not help with Java class IO. Try getting a thread dump of the JVM (e.g., kill -3) while these logs are being written to. You should be able to catch a thread red handed with java.io packages near the top of the stack trace.

A: 

Try placing a breakpoint in the File class' constructors and the mkdir and createNewFile methods. Generally, code will use the File class to create its files or directories. You should have the Java source code for these classes included with your JVM.

MetroidFan2002
It took a lot of time hitting F8 but I tracked it down :) thx
shyam
Sometimes, that's the only way to get it done :)
MetroidFan2002
+3  A: 

Add "-Dlog4j.debug" to the command line and there will be extra info in standard output about how it is configured.

James A. N. Stauffer