users@glassfish.java.net

Re: Log4J

From: Alex Sherwin <alex.sherwin_at_acadiasoft.com>
Date: Fri, 07 Aug 2009 16:17:28 -0400

You shouldn't get any errors if log4j is configured properly

For a WAR you can place your log4j.properties in WEB-INF/classes (if you
dont have this dir, you can create it and only put log4j props in there)

The root of where it places the log files is the
/glassfish/domains/<your_domain>/config directory. You can set your log
file to be at a relative path from there to get it where you like.

I use log4j.xml (instead of a properties file) with no issues, in WARs
as I've described, or at the root level of an EAR

glassfish_at_javadesktop.org wrote:
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>
>