Sorry, they're so different wish there were different mls. However with a max size you'd have to subclass the daily rolling file appender and tweak the rollover method (I think) to do the size check and potentially call the super class. On Jun 3, 2014 3:27 PM, "Akash Jain" <[email protected]> wrote:
> I am not using log4j 2 currently. > > > On Tue, Jun 3, 2014 at 11:08 AM, Gary Gregory <[email protected]> > wrote: > > > James is talking about log4j 2 I think. > > > > Gary > > > > <div>-------- Original message --------</div><div>From: Akash Jain < > > [email protected]> </div><div>Date:06/03/2014 13:19 (GMT-05:00) > > </div><div>To: Log4J Users List <[email protected]> > > </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 <[email protected]> > > 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 <[email protected] > > > > > 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: [email protected] > > > > For additional commands, e-mail: [email protected] > > > > > > > > > > > > > >
