Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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

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

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

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.

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