logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akash Jain <akash.delh...@gmail.com>
Subject Re: DailyRollingFileAppender with Max size
Date Tue, 03 Jun 2014 19:27:26 GMT
I am not using log4j 2 currently.


On Tue, Jun 3, 2014 at 11:08 AM, Gary Gregory <garydgregory@gmail.com>
wrote:

> James is talking about log4j 2 I think.
>
> Gary
>
> <div>-------- Original message --------</div><div>From: Akash Jain
<
> akash.delhite@gmail.com> </div><div>Date:06/03/2014  13:19  (GMT-05:00)
> </div><div>To: Log4J Users List <log4j-user@logging.apache.org>
> </div><div>Subject: Re: DailyRollingFileAppender with Max size </div><div>
> </div>This is my current appender -
>
> <appender name="rolling.log"
> class="org.apache.log4j.DailyRollingFileAppender">
>         <param name="file"  value="mylog.log" />
>         <param name="append" value="true" />
>         <param name="bufferedIO" value="false" />
>
>         <param name="DatePattern" value="'.'yyyy-MM-dd" />
>         <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern" value="%d{yyyy-MM-dd
> HH:mm:ss,SSS} %-5p [%-10t%x] %-10.10c{1} %m%n" />
>         </layout>
>     </appender>
>
>
> On Tue, Jun 3, 2014 at 5:17 AM, James Hutton <james.a.hutton@gmail.com>
> wrote:
>
> > Akash,
> > You can, but I think without modifying the conversion pattern (adding %i)
> > it isn't possible.  You can use multiple rollover policies, you would end
> > up using the SizeBaseRolloverPolicy(?).  I'm assuming if you have the
> time
> > based rollover policy that you're using the date string.
> >
> > James
> >
> >
> > On Tue, Jun 3, 2014 at 7:21 AM, Steffen Ryll <steffen.ryll@iteratec.de>
> > wrote:
> >
> > > Looks as if you forgot pasting the conversion pattern.
> > > Can you clarify?
> > >
> > > /Steffen
> > >
> > > Am 03.06.2014 08:54, schrieb Akash Jain:
> > > > Hi,
> > > >
> > > > I am using org.apache.log4j.DailyRollingFileAppender for my logs with
> > > > following conversion pattern :
> > > >
> > > > But I also want to use max File Size with this, so that the file is
> > > rolled
> > > > if it reaches a max size even if same day.
> > > >
> > > > How can I achieve this ?
> > > >
> > > > Thanks.
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message