| Author |
DailyRollingFileHandler -— Files should be rotated on a daily basis
|
Dyann Sri
Greenhorn
Joined: Dec 13, 2007
Posts: 27
|
|
We have a requirment which requires to have an Handler that is extended from Java logging and allows to have the files rotated on daily basis.
Currently Java util logging do have the support of rotation based on file size by using File Handler. It doesnt support rotation on daily basis. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6350749
So , what we are looking is for such an appender that allows daily rotation . We would like to write such handler and which is the appropriate handler to extend for ... StreamHandler or FileHandler ? And other questions are , is there way we can configure 2 different files for a single handler say FileHandler say for eg , we would like some kind of messages need to be captured in one file and other messages in other file.
Would appreciate for any comments.
|
 |
salvin francis
Ranch Hand
Joined: Jan 12, 2009
Posts: 900
|
|
There is a software library that does exactly what you want:
http://logging.apache.org/log4j/
tons of cool logging stuff that can be done here.
|
I came, I saw, I set a new standard.
[Salvin.in]- The way websites should now be.
|
 |
salvin francis
Ranch Hand
Joined: Jan 12, 2009
Posts: 900
|
|
on a side note, you might want to consider changing your signature.
|
 |
Dyann Sri
Greenhorn
Joined: Dec 13, 2007
Posts: 27
|
|
|
We are exploring other alternatives by extending Java logging framework instead of using 3rd party frameworks ...
|
 |
Rob Spoor
Saloon Keeper
Joined: Oct 27, 2005
Posts: 17259
|
|
|
Why reinvent the wheel when the current wheels are just working fine? What's one single JAR file that is even allowed to be used in commercial products (as per the Apache License Log4J is released under)?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
salvin francis
Ranch Hand
Joined: Jan 12, 2009
Posts: 900
|
|
Dyann Sri wrote:We are exploring other alternatives by extending Java logging framework instead of using 3rd party frameworks ...
any particular reason why ?
|
 |
 |
|
|
subject: DailyRollingFileHandler -— Files should be rotated on a daily basis
|
|
|