You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Frank Burns <fr...@the-hub.demon.co.uk> on 2004/02/26 13:57:38 UTC

Setting location of Log4j RollingFileAppender

I am logging requests from my app to a DailyRollingFileAppender (see
log4j.properties file entry below).
However, the file is saved in the CATALINA_HOME/bin directory.
But I want to read the file from the the app.
How can I save it to the context's file directory?

Ultimately, I want to access the file from the app and email it, on a daily
basis, to interested parties.
Is this the best method of doing this?

Thanks,

Frank.

*** excerpt from log4j properties file ***
# Daily rolling file appender
log4j.appender.myLogFile=org.apache.log4j.RollingFileAppender
log4j.appender.myLogFile.File=mylog.log
...
log4j.appender.myLogFile.threshold=INFO



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


Re: Setting location of Log4j RollingFileAppender

Posted by Frank Burns <fr...@the-hub.demon.co.uk>.
Thank you Mike!
And I also discovered that you can use system properties -- delimited with
${ and }, like this ${<system property>} -- to specify parts of the path,
such as: ${catalina.home}.
Frank.

----- Original Message ----- 
From: "Mike Curwen" <gb...@gb-im.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Thursday, February 26, 2004 3:16 PM
Subject: RE: Setting location of Log4j RollingFileAppender


> change:
> log4j.appender.myLogFile.File=mylog.log
> to:
> log4j.appender.myLogFile.File=/home/webhome/www.foo.com/WEB-INF/logs/myl
> og.log
>
> (obviously your paths will differ, but the point here is to make it an
> absolute path)
>
>
> > -----Original Message-----
> > From: Frank Burns [mailto:frankburns@the-hub.demon.co.uk]
> > Sent: Thursday, February 26, 2004 6:58 AM
> > To: Tomcat Users List
> > Subject: Setting location of Log4j RollingFileAppender
> >
> >
> > I am logging requests from my app to a
> > DailyRollingFileAppender (see log4j.properties file entry
> > below). However, the file is saved in the CATALINA_HOME/bin
> > directory. But I want to read the file from the the app. How
> > can I save it to the context's file directory?
> >
> > Ultimately, I want to access the file from the app and email
> > it, on a daily basis, to interested parties. Is this the best
> > method of doing this?
> >
> > Thanks,
> >
> > Frank.
> >
> > *** excerpt from log4j properties file ***
> > # Daily rolling file appender
> > log4j.appender.myLogFile=org.apache.log4j.RollingFileAppender
> > log4j.appender.myLogFile.File=mylog.log
> > ...
> > log4j.appender.myLogFile.threshold=INFO
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


RE: Setting location of Log4j RollingFileAppender

Posted by Mike Curwen <gb...@gb-im.com>.
change:
log4j.appender.myLogFile.File=mylog.log
to:
log4j.appender.myLogFile.File=/home/webhome/www.foo.com/WEB-INF/logs/myl
og.log
 
(obviously your paths will differ, but the point here is to make it an
absolute path)


> -----Original Message-----
> From: Frank Burns [mailto:frankburns@the-hub.demon.co.uk] 
> Sent: Thursday, February 26, 2004 6:58 AM
> To: Tomcat Users List
> Subject: Setting location of Log4j RollingFileAppender
> 
> 
> I am logging requests from my app to a 
> DailyRollingFileAppender (see log4j.properties file entry 
> below). However, the file is saved in the CATALINA_HOME/bin 
> directory. But I want to read the file from the the app. How 
> can I save it to the context's file directory?
> 
> Ultimately, I want to access the file from the app and email 
> it, on a daily basis, to interested parties. Is this the best 
> method of doing this?
> 
> Thanks,
> 
> Frank.
> 
> *** excerpt from log4j properties file ***
> # Daily rolling file appender 
> log4j.appender.myLogFile=org.apache.log4j.RollingFileAppender
> log4j.appender.myLogFile.File=mylog.log
> ...
> log4j.appender.myLogFile.threshold=INFO
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


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