On Thu, 21 Aug 2008 17:45:13 +0530
"Aneez Backer" <[EMAIL PROTECTED]> wrote:
If you don't want log4j to avoid the default initialization procedure you
can set the log4j.defaultInitOverrride system property to anything other
than "false".
How does log4j interpret defaultInitOverride?? Does any value other than
'false' imply true ?? Does 'null' also imply true ??
I didn't look at the code, but usually a boolean is not true unless explicitly
set to "true". Anything else is false. Then again, it could be simply
looking for the existence of the property, in which case even setting it to
"false" should enable this option. I don't have the time to review it, but
you can always look at this yourself. Look up the source for LogManager.java
and see what it does.
Jake
Thanks
Aneez
----- Original Message ----- From: "Michael Erskine"
<[EMAIL PROTECTED]>
To: "Log4J Users List" <log4j-user@logging.apache.org>
Sent: Tuesday, August 19, 2008 1:49 PM
Subject: RE: Can custom appender override the log4j.xml configuration
Hi Aneez,
I initialise the Logger instance as follows:
Logger customLogger = Logger.getLogger("myCustomLogger");
/ / remove all appenders associated with customLogger
customLogger.removeAllAppenders();
// add JDBCAppenderService to customLogger
customLogger .addAppender(new JDBCAppenderService(ds)); //ds is the
datasource name
How about removing all appenders from the root logger? Or is that not what
you want to achieve? Remember that the loggers are hierarchical.
I want customLogger to remained unaffected by the settings in the
log4j.xml
file. So, if the logging level in log4j.xml is set to OFF, I still want
the
JDBC appneder to work i.e log data in the database.
You can programmatically set the logging level of your appender.
Please let me know if there any way to achieve this ?? Or does the
log4j.xml
configuration overrides the settings in the class files ??
If you don't want log4j to avoid the default initialization procedure you
can set the log4j.defaultInitOverrride system property to anything other than
"false".
Regards,
Michael Erskine.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]