On May 17, 2006, at 1:00 PM, James Stauffer wrote:

Run with -Dlog4j.debug and it should show you how it it trying to
configure itself.


Default configuration should occur BEFORE XmlSplitter.main() is entered and the "log4j.file.name" system property is set. To me, it looks like it would occur during the getLogger() call. If you want to set the property, either:

a) use a command line option, -Dlog4j.file.name=XmlSplitter
b) ensure that the system property is set before the call to Logger.getLogger()
c) explicitly initialize logging

For option b, you could do something like:

private static final Logger logger = createLogger();

private static final Logger createLogger() {
          System.setProperty("log4j.file.name", "XmlSplitter");
          return Logger.getLogger(XmlSplitter.class.getName());
}

However, if something else triggers default initialization, you could still have the same issue of setting the property after it was attempted to be used.

If your problem wasn't a bungled file name due to the property not being set, then please elaborate on what appears to be going wrong.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to