You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Desai, Chetan P [ITS]" <Ch...@mail.sprint.com> on 2004/03/03 20:41:42 UTC
Cannot switch from BasicConfiguration to PropertyConfiguration
If I attempt to switch from Basic to Property, it stops logging. Sorry if its a repeat question.
Thanks in advance !
-Chetan desai.
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.PropertyConfigurator;
...
try
{
// setup logger for initial startup of an app
org.apache.log4j.BasicConfigurator.configure();
// switch to configured log once the app is started
// notice the log entries do not show, unless you comment out the line below
// on log4j 1.2.8 and commons-logging
PropertyConfigurator.configure(args[0]);
throw new Error("testing error");
}
catch (Throwable e)
{
System.err.println("err out Exception in main: " + e);
log.fatal("Exception in main: " + e, e);
}
finally
{
System.err.println("err out final exit");
log.info("final exit");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org