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 Kailash KN <ka...@thbs.com> on 2006/05/11 15:21:09 UTC
Stuck with file format!!!
Hi,
I would like to have my Debug and Info messages into Debug.log and Info.log respectively, this works fine, but now i would like to have it in the log files with the format- yyyy-MM-dd-Debug.log and yyyy-MM-dd-Info.log respectively. how do i go about it???
Any help would be greatly appreciated!!!
Thanks & Regards,
Kailash.K.N.
Re: Stuck with file format!!!
Posted by James Stauffer <st...@gmail.com>.
For log4j 1.2 you would need to create a new FileAppender class.
On 5/11/06, Kailash KN <ka...@thbs.com> wrote:
> Thanks Dirk and James, but i use a property file not an XML file, anyways
> ill give it a shot.
>
> james, i did not understand your reply, could be please be more precise.
>
> Thanks & Regards,
> Kailash.K.N.
>
> ----- Original Message -----
> From: "dirk ooms" <di...@onesparrow.com>
> To: "Log4J Users List" <lo...@logging.apache.org>
> Sent: Thursday, May 11, 2006 7:23 PM
> Subject: Re: Stuck with file format!!!
>
>
> > in log4j1.3, i do something like this to put the date in the filename
> >
> > <appender name="myAppender"
> > class="org.apache.log4j.rolling.RollingFileAppender">
> > <param name="Threshold" value="DEBUG"/>
> > <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
> > <param name="FileNamePattern" value="%d{yyyy-MM-dd}.log.gz"/>
> > </rollingPolicy>
> > <layout class="org.apache.log4j.PatternLayout">
> > <param name="ConversionPattern" value="[%d{HH:mm:ss}, %p, %c{1}]
> > %m%n"/>
> > </layout>
> > </appender>
> >
> >
> > On Thursday 11 May 2006 15:21, Kailash KN wrote:
> >> Hi,
> >> I would like to have my Debug and Info messages into Debug.log and
> >> Info.log
> >> respectively, this works fine, but now i would like to have it in the log
> >> files with the format- yyyy-MM-dd-Debug.log and yyyy-MM-dd-Info.log
> >> respectively. how do i go about it???
> >>
> >> Any help would be greatly appreciated!!!
> >>
> >> Thanks & Regards,
> >> Kailash.K.N.
> >
> > ---------------------------------------------------------------------
> > 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
>
>
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Stuck with file format!!!
Posted by Kailash KN <ka...@thbs.com>.
Thanks Dirk and James, but i use a property file not an XML file, anyways
ill give it a shot.
james, i did not understand your reply, could be please be more precise.
Thanks & Regards,
Kailash.K.N.
----- Original Message -----
From: "dirk ooms" <di...@onesparrow.com>
To: "Log4J Users List" <lo...@logging.apache.org>
Sent: Thursday, May 11, 2006 7:23 PM
Subject: Re: Stuck with file format!!!
> in log4j1.3, i do something like this to put the date in the filename
>
> <appender name="myAppender"
> class="org.apache.log4j.rolling.RollingFileAppender">
> <param name="Threshold" value="DEBUG"/>
> <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
> <param name="FileNamePattern" value="%d{yyyy-MM-dd}.log.gz"/>
> </rollingPolicy>
> <layout class="org.apache.log4j.PatternLayout">
> <param name="ConversionPattern" value="[%d{HH:mm:ss}, %p, %c{1}]
> %m%n"/>
> </layout>
> </appender>
>
>
> On Thursday 11 May 2006 15:21, Kailash KN wrote:
>> Hi,
>> I would like to have my Debug and Info messages into Debug.log and
>> Info.log
>> respectively, this works fine, but now i would like to have it in the log
>> files with the format- yyyy-MM-dd-Debug.log and yyyy-MM-dd-Info.log
>> respectively. how do i go about it???
>>
>> Any help would be greatly appreciated!!!
>>
>> Thanks & Regards,
>> Kailash.K.N.
>
> ---------------------------------------------------------------------
> 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: Stuck with file format!!!
Posted by dirk ooms <di...@onesparrow.com>.
in log4j1.3, i do something like this to put the date in the filename
<appender name="myAppender"
class="org.apache.log4j.rolling.RollingFileAppender">
<param name="Threshold" value="DEBUG"/>
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
<param name="FileNamePattern" value="%d{yyyy-MM-dd}.log.gz"/>
</rollingPolicy>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{HH:mm:ss}, %p, %c{1}] %m%n"/>
</layout>
</appender>
On Thursday 11 May 2006 15:21, Kailash KN wrote:
> Hi,
> I would like to have my Debug and Info messages into Debug.log and Info.log
> respectively, this works fine, but now i would like to have it in the log
> files with the format- yyyy-MM-dd-Debug.log and yyyy-MM-dd-Info.log
> respectively. how do i go about it???
>
> Any help would be greatly appreciated!!!
>
> Thanks & Regards,
> Kailash.K.N.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Stuck with file format!!!
Posted by James Stauffer <st...@gmail.com>.
Create a new appender. I wrote a 1.2 appender that can do that. 1.3
may be able to do this.
On 5/11/06, Kailash KN <ka...@thbs.com> wrote:
> Hi,
> I would like to have my Debug and Info messages into Debug.log and Info.log respectively, this works fine, but now i would like to have it in the log files with the format- yyyy-MM-dd-Debug.log and yyyy-MM-dd-Info.log respectively. how do i go about it???
>
> Any help would be greatly appreciated!!!
>
> Thanks & Regards,
> Kailash.K.N.
>
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org