log4j initialization is running because of explicit programmatic configuration (via PropertyConfigurator/DOMConfigurator) or more likely a static logger declaration or a logger instance be initialized prior to your configuration code being ran.
I'd suggest changing your logger declarations to be non-static and moving your initialization logic into a static block at the top of the first class that is being loaded. Scott On Mon, Jul 18, 2011 at 1:47 PM, Turner, Jay <[email protected]>wrote: > I call my Library Jar which has log4j setup in it. I'm calling a static > method in my class. Before I can get to the > LogManager.setRepositorySelector, log4j gets to run, loads its configuration > from log4j.configuration, can't interpret the unrecognized parameters, and > generally finishes initialization. I suspect that when I enter the Library > to run a static method that all of the other statics are run, along with the > statics in log4j.jar. So log4j initializes before you can get a chance to > setup anything. Unless I'm missing something, how can I get around this > Catch-22? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
