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 James Stauffer <st...@gmail.com> on 2006/04/26 02:00:16 UTC

Re: [BULK] Question about RollingFileAppender

In 1.3 you can probably implement a TriggerPolicy but I don't know how
you would change the name.

On 4/25/06, Shriraghavan, Sowmya <SS...@ea.com> wrote:
> I should have been more specific. I have an idea about what to do about
> extending RollingFileAppender. I was just checking out the docs for 1.3
> alpha 8 - this mentions a different constructor etc. I was wondering if
> anyone knew what the difference was and if I had to still extend
> RollingFileAppender? (The one in 1.2 has been deprecated - hence my
> question).
>
> The link for the new class. It's in log4j.rolling instead of just the
> log4j package.
>
> http://logging.apache.org/log4j/docs/api-1.3/org/apache/log4j/rolling/Ro
> llingFileAppender.html
>
> Sowmya
>
>
> -----Original Message-----
> From: Philip Denno [mailto:pdenno@tsi.bc.ca]
> Sent: Tuesday, April 25, 2006 4:07 PM
> To: Log4J Users List
> Subject: RE: [BULK] Question about RollingFileAppender
>
> You need to create your own appender by subclassing RollingFileAppender
> and implement the roll method (I think that is what it is called).
>
> You could then rename the file the way you want.
>
> Example:
>
>         1) Call super.roll(); <-- Creates the standard file.
>         2) Call File.renameTo(); <-- Renames the file from Step 1 to
> your specific name.
>
> Cheers,
> Philip.
>
> -----Original Message-----
> From: Shriraghavan, Sowmya [mailto:SShriraghavan@ea.com]
> Sent: Tuesday, April 25, 2006 3:44 PM
> To: Log4J Users List
> Subject: [BULK] Question about RollingFileAppender
> Importance: Low
>
> Hi all,
>
>
>
> I need to log files based on size, but instead of rotating them like
> RollingFileAppender does (myfile.1, myfile.2 etc), I have to just append
> the current timestamp to the rolled file and that's it. So my rolled
> over file should look like myfile.04-25-2006-14:20:39.log (where the
> file rolled over or exceeded maxfilesize at 2:20PM on 25th April 2006).
> Do I need to write my own appender? I am a little confused about the 1.3
> RollingFileAppender - I'm using property files and no xml files. I need
> this done asap, so I would greatly appreciate any help.
>
>
>
> Thanks,
>
> Sowmya
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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