Put your log4j.properties into WEB-INF/classes/your_file_here
And you log file locations can be set a absolute path, or only a file name.
I'm use a full path, ex /home/user/applications/logs/my_logs_here.
But, only works fine if your start the Log4j engine By hand, with
BasicConfigurator.configure(), in this method log4j read properties and
configure the streams.
Regards
Ronaldo.
2009/8/7 <glassfish_at_javadesktop.org>
> 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
>
>
--
[]'s,
Ronaldo Rigoni
http://www.ronaldorigoni.com.br
Desenvolvedor JEE
Ministério da Educação - CESPE