You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by sa...@namics.com on 2004/03/02 08:43:51 UTC

LocationInfo when extending Log4j

Hi all,
We have integrated log4j in our general logging-infrastructure. for this 
purposes we extended log4j as described in the manual (decorator-pattern).
Everything worked fine since i've seen that some character in the 
ConversionPattern do not show up in the log (%L and %M as examples).
After investigating some time on this issue i saw that the LocationInfo 
class parses this information out of the stacktrace.

My question now is: what is the best way to get this information back in 
the log even if log4j is wrapped?

Best regard,
Sandro

Re: DailyRollingFileAppender does not create its archive files

Posted by Ceki Gülcü <ce...@qos.ch>.
Adding the log4j.debug=true directive to your config file should give you 
better information.

At 03:23 PM 3/2/2004 +0000, you wrote:
>I am using log4j in my Tomcat-based application to create daily log files
>using the DailyRollingFileAppender.
>
>The development environment is Tomcat 5.0.16 on a Windows XP-based machine
>and the production environment is Tomcat 5.0.19 on Linux-based server.
>
>I use exactly the same log4j jar files on each.
>
>The problem is that in the XP-based system the DailyRollingFileAppender does
>not create any archive files.
>
>However, on the Linux-based machine everything works as expected.
>
>Any ideas?
>
>The properties file I am using is given below. (I comment out whichever
>"log4j.appender.R.File=..." line is appropriate for the development
>environment the file is deployed in.)
>
>
># Assign two appenders to root logger
>log4j.rootLogger=DEBUG, R
>
># Rolling file appender
>log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
>
># for Windows Home on development machine
>log4j.appender.R.File=E:/SoftwareDevelopment/eclipse/workspace/amxtrcdeploy/
>WEB-INF/log4j-logfiles/admin_log
>
># for Linux on production server
>#
>log4j.appender.R.File=/projects/amexback/webapp/WEB-INF/log4j-logfiles/admin
>_log
>
># roll the file over every minute! (Just for testing.)
># log4j.appender.R.DatePattern='.'yyyy-MM-dd-HH-mm
>
># roll the file over daily, at midnight
>log4j.appender.R.DatePattern='.'yyyy-MM-dd
>
>log4j.appender.R.layout=org.apache.log4j.PatternLayout
>log4j.appender.R.layout.ConversionPattern=%d %-5p %m%n
>log4j.appender.R.threshold=INFO
>
># Print only messages of level INFO or above from the admin.audit logger
>log4j.logger.admin.audit=INFO

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: DailyRollingFileAppender does not create its archive files

Posted by Frank Burns <fr...@the-hub.demon.co.uk>.
Thank you Dave.

----- Original Message ----- 
From: "Dave Jones" <dj...@earthlink.net>
To: "Log4J Users List" <lo...@logging.apache.org>
Sent: Tuesday, March 02, 2004 5:09 PM
Subject: Re: DailyRollingFileAppender does not create its archive files


> The problem is that Windows holds a lock on the log file,
> preventing log4j from renaming it to an archive version. Thus
> when the next log is started, it simply overwrites the old log
> instead of writing to a new log.
>
> Purportedly the new version of log4j addresses this, but I
> haven't had a chance to test it. There are also mods to log4j
> floating around to address this. I'm playing around with
> scheduling an at command to rename the log file a few minutes
> before log4j rolls over the file, but haven't worked out the bugs yet.
>
> Dave Jones
> NetEffect
>
>
> At 03:23 PM 3/2/04 +0000, you wrote:
> >I am using log4j in my Tomcat-based application to create daily log files
> >using the DailyRollingFileAppender.
> >
> >The development environment is Tomcat 5.0.16 on a Windows XP-based
machine
> >and the production environment is Tomcat 5.0.19 on Linux-based server.
> >
> >I use exactly the same log4j jar files on each.
> >
> >The problem is that in the XP-based system the DailyRollingFileAppender
does
> >not create any archive files.
> >
> >However, on the Linux-based machine everything works as expected.
> >
> >Any ideas?
> >
> >The properties file I am using is given below. (I comment out whichever
> >"log4j.appender.R.File=..." line is appropriate for the development
> >environment the file is deployed in.)
> >
> >
> ># Assign two appenders to root logger
> >log4j.rootLogger=DEBUG, R
> >
> ># Rolling file appender
> >log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
> >
> ># for Windows Home on development machine
>
>log4j.appender.R.File=E:/SoftwareDevelopment/eclipse/workspace/amxtrcdeploy
/
> >WEB-INF/log4j-logfiles/admin_log
> >
> ># for Linux on production server
> >#
>
>log4j.appender.R.File=/projects/amexback/webapp/WEB-INF/log4j-logfiles/admi
n
> >_log
> >
> ># roll the file over every minute! (Just for testing.)
> ># log4j.appender.R.DatePattern='.'yyyy-MM-dd-HH-mm
> >
> ># roll the file over daily, at midnight
> >log4j.appender.R.DatePattern='.'yyyy-MM-dd
> >
> >log4j.appender.R.layout=org.apache.log4j.PatternLayout
> >log4j.appender.R.layout.ConversionPattern=%d %-5p %m%n
> >log4j.appender.R.threshold=INFO
> >
> ># Print only messages of level INFO or above from the admin.audit logger
> >log4j.logger.admin.audit=INFO
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: DailyRollingFileAppender does not create its archive files

Posted by Dave Jones <dj...@earthlink.net>.
The problem is that Windows holds a lock on the log file, 
preventing log4j from renaming it to an archive version. Thus 
when the next log is started, it simply overwrites the old log 
instead of writing to a new log.

Purportedly the new version of log4j addresses this, but I 
haven't had a chance to test it. There are also mods to log4j 
floating around to address this. I'm playing around with 
scheduling an at command to rename the log file a few minutes 
before log4j rolls over the file, but haven't worked out the bugs yet.

Dave Jones
NetEffect


At 03:23 PM 3/2/04 +0000, you wrote:
>I am using log4j in my Tomcat-based application to create daily log files
>using the DailyRollingFileAppender.
>
>The development environment is Tomcat 5.0.16 on a Windows XP-based machine
>and the production environment is Tomcat 5.0.19 on Linux-based server.
>
>I use exactly the same log4j jar files on each.
>
>The problem is that in the XP-based system the DailyRollingFileAppender does
>not create any archive files.
>
>However, on the Linux-based machine everything works as expected.
>
>Any ideas?
>
>The properties file I am using is given below. (I comment out whichever
>"log4j.appender.R.File=..." line is appropriate for the development
>environment the file is deployed in.)
>
>
># Assign two appenders to root logger
>log4j.rootLogger=DEBUG, R
>
># Rolling file appender
>log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
>
># for Windows Home on development machine
>log4j.appender.R.File=E:/SoftwareDevelopment/eclipse/workspace/amxtrcdeploy/
>WEB-INF/log4j-logfiles/admin_log
>
># for Linux on production server
>#
>log4j.appender.R.File=/projects/amexback/webapp/WEB-INF/log4j-logfiles/admin
>_log
>
># roll the file over every minute! (Just for testing.)
># log4j.appender.R.DatePattern='.'yyyy-MM-dd-HH-mm
>
># roll the file over daily, at midnight
>log4j.appender.R.DatePattern='.'yyyy-MM-dd
>
>log4j.appender.R.layout=org.apache.log4j.PatternLayout
>log4j.appender.R.layout.ConversionPattern=%d %-5p %m%n
>log4j.appender.R.threshold=INFO
>
># Print only messages of level INFO or above from the admin.audit logger
>log4j.logger.admin.audit=INFO
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


DailyRollingFileAppender does not create its archive files

Posted by Frank Burns <fr...@the-hub.demon.co.uk>.
I am using log4j in my Tomcat-based application to create daily log files
using the DailyRollingFileAppender.

The development environment is Tomcat 5.0.16 on a Windows XP-based machine
and the production environment is Tomcat 5.0.19 on Linux-based server.

I use exactly the same log4j jar files on each.

The problem is that in the XP-based system the DailyRollingFileAppender does
not create any archive files.

However, on the Linux-based machine everything works as expected.

Any ideas?

The properties file I am using is given below. (I comment out whichever
"log4j.appender.R.File=..." line is appropriate for the development
environment the file is deployed in.)


# Assign two appenders to root logger
log4j.rootLogger=DEBUG, R

# Rolling file appender
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender

# for Windows Home on development machine
log4j.appender.R.File=E:/SoftwareDevelopment/eclipse/workspace/amxtrcdeploy/
WEB-INF/log4j-logfiles/admin_log

# for Linux on production server
#
log4j.appender.R.File=/projects/amexback/webapp/WEB-INF/log4j-logfiles/admin
_log

# roll the file over every minute! (Just for testing.)
# log4j.appender.R.DatePattern='.'yyyy-MM-dd-HH-mm

# roll the file over daily, at midnight
log4j.appender.R.DatePattern='.'yyyy-MM-dd

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %-5p %m%n
log4j.appender.R.threshold=INFO

# Print only messages of level INFO or above from the admin.audit logger
log4j.logger.admin.audit=INFO



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org