users@glassfish.java.net

Re: RE: Log4J

From: <glassfish_at_javadesktop.org>
Date: Fri, 07 Aug 2009 13:12:24 PDT

Question 1: where should I put the Log4J.properties file?

Question 2: Where should I define the log file path?

My Log4J.properties:

log4j.logger.com.acupuncture=INFO
log4j.logger.org=INFO

log4j.rootLogger=INFO, STDOUT
log4j.rootCategory=INFO

log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%5p [%t] - %m%n

log4j.appender.TOFILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.TOFILE.File=../logs/ais.log
log4j.appender.TOFILE.DatePattern='.'yyyy-MM-dd
log4j.appender.TOFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.TOFILE.layout.ConversionPattern=%d{dd MMM HH:mm:ss} %p %t %c - %m%n

log4j.appender.ERRFILE=com.acupuncture.util.logging.ErrorLogAppender
log4j.appender.ERRFILE.File=../logs/exception.log
log4j.appender.ERRFILE.DatePattern='.'yyyy-MM-dd
log4j.appender.ERRFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ERRFILE.layout.ConversionPattern=%d{dd MMM HH:mm:ss} %p %t %c - %m%n
[Message sent by forum member 'henryliu' (henryliu)]

http://forums.java.net/jive/thread.jspa?messageID=359495