How do you initial a logger in your java code? It will use different loggers depends on that. Anymore, the below parameters are useful for config that. log4j.additivity.database=false/true
Best Regards Xi Yuxiang System Architect Maveo Systems Limited --------------------------------------------------------------------- This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. -----Original Message----- From: Sudarshan Krishnaprasad [mailto:[EMAIL PROTECTED] Sent: 2003年10月14日 3:27 To: Log4J Users List Subject: Problem with multiple appenders. Hi, The log4j.properties file is as shown below. I have 2 appenders set and wish to log the different levels to different places. log4j.properties log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n log4j.appender.R=org.apache.log4j.jdbc.JDBCAppender log4j.appender.R.URL=jdbc:mysql://localhost/test log4j.appender.R.user=test log4j.appender.R.password=test log4j.appender.R.sql=INSERT INTO logTable (timestamp,priority,filename,msg) VALUES ('%d', '%p', '%c', '%m') log4j.rootLogger=ALL, stdout log4j.logger.database=ERROR, R The problem I am having is that all the messages are getting logged at the console but none of them are getting logged to the database. If I change the file a little bit and set the root logger to log at both the places like: log4j.rootLogger=ALL, stdout, R Now all the messages are logged in both the places. Could anyone please tell me if the above methods for having multiple loggers is correct. Regards, Sudarshan. --------------------------------------------------------------------- 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]