You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Paula McDowell <pm...@hotmail.com> on 2008/01/23 16:44:03 UTC
FW: DailyRollingFileAppender for a Struts Web Application using WAS
6.0 and Struts 1.1
Hi, all. Is there a way to set a DailyRollingFileAppender outside of a log4j.properties in a struts application? My company’s website is running in a mainfame environment with multiple WAS instances for each region ie., development, test, and production. This type of architecture requires my log file to be environment specific i.e. /temp/dev/log or /temp/prod/log. I could have a log4j.properties for each environment, but don’t really feel good about that approach.
I’ve created a StartUp plugin that will create a log file using a variable defined as a WAS Resource Environment Entry. The plugin reads the variable and thus creates and names the log file appropriately. I have yet to figure out how to instantiate a DailyRollingFileAppender that will roll this file and create a new log at the beginning of each day.
Thanks,
Paula
_________________________________________________________________
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
RE: DailyRollingFileAppender for a Struts Web Application using WAS
6.0 and Struts 1.1
Posted by Paula McDowell <pm...@hotmail.com>.
Thanks. I'll give it a try.
> From: hoju@visi.com
> Subject: Re: FW: DailyRollingFileAppender for a Struts Web Application using WAS 6.0 and Struts 1.1
> To: log4j-dev@logging.apache.org
> Date: Wed, 23 Jan 2008 11:10:32 -0600
>
>
> java ... -Dlog.dir=/my/preferred/path WAS
>
> In log4j.properties....
>
> log4j.appender.MyAppender.File=${log.dir}/mylogfile.log
>
>
> Now you can use the same log file for all environments. Just make sure you
> set the system property at startup.
>
> Jake
>
> On Wed, 23 Jan 2008 09:44:03 -0600
> Paula McDowell <pm...@hotmail.com> wrote:
> >
> > Hi, all. Is there a way to set a DailyRollingFileAppender outside of a
> >log4j.properties in a struts application? My company’s website is running in
> >a mainfame environment with multiple WAS instances for each region ie.,
> >development, test, and production. This type of architecture requires my log
> >file to be environment specific i.e. /temp/dev/log or /temp/prod/log. I could
> >have a log4j.properties for each environment, but don’t really feel good
> >about that approach.
> >
> > I’ve created a StartUp plugin that will create a log file using a variable
> >defined as a WAS Resource Environment Entry. The plugin reads the variable
> >and thus creates and names the log file appropriately. I have yet to figure
> >out how to instantiate a DailyRollingFileAppender that will roll this file
> >and create a new log at the beginning of each day.
> >
> > Thanks,
> >
> > Paula
> >
> > _________________________________________________________________
> > Shed those extra pounds with MSN and The Biggest Loser!
> > http://biggestloser.msn.com/
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> >For additional commands, e-mail: log4j-dev-help@logging.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
_________________________________________________________________
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/
Re: FW: DailyRollingFileAppender for a Struts Web Application using WAS 6.0 and Struts 1.1
Posted by Jacob Kjome <ho...@visi.com>.
java ... -Dlog.dir=/my/preferred/path WAS
In log4j.properties....
log4j.appender.MyAppender.File=${log.dir}/mylogfile.log
Now you can use the same log file for all environments. Just make sure you
set the system property at startup.
Jake
On Wed, 23 Jan 2008 09:44:03 -0600
Paula McDowell <pm...@hotmail.com> wrote:
>
> Hi, all. Is there a way to set a DailyRollingFileAppender outside of a
>log4j.properties in a struts application? My company’s website is running in
>a mainfame environment with multiple WAS instances for each region ie.,
>development, test, and production. This type of architecture requires my log
>file to be environment specific i.e. /temp/dev/log or /temp/prod/log. I could
>have a log4j.properties for each environment, but don’t really feel good
>about that approach.
>
> I’ve created a StartUp plugin that will create a log file using a variable
>defined as a WAS Resource Environment Entry. The plugin reads the variable
>and thus creates and names the log file appropriately. I have yet to figure
>out how to instantiate a DailyRollingFileAppender that will roll this file
>and create a new log at the beginning of each day.
>
> Thanks,
>
> Paula
>
> _________________________________________________________________
> Shed those extra pounds with MSN and The Biggest Loser!
> http://biggestloser.msn.com/
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org