Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can we use both RollingFileAppender and DailyRollingFileAppender

Status
Not open for further replies.

itsnotmehere

Programmer
Nov 21, 2005
1
0
0
US
Hi all,

Fairly new to using Log4J. I have a state where I need to start a new log file once every week and if the file size exceeds 20 MB in the mean time then it needs to start a new logfile as well.

I understand that RollingFileAppender and DailyRollingFileAppender can be used individually but my questions is can we club these two together to achieve my purpose.

Thanks in advance for your time.
 
Mmmm. I don't think you can 'chain' appenders together so you'll probably need to get hold of a 3rd party appender which has the behaviour you need. There are a few dotted around the web.

If you're feeling adventurous, you could always write your own appender. As a starter, it would probably be best to extend on of the two you mentioned.

This article may assist you if you have a go.

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
... any response isnotmehere? I feel so alone [sad]....

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
isnotmehere-

Can you let us know if you found a answer? This could be very helpful becuase it would allow me to keep my daily log files trimmed down in size.

If not, I might look at extending the daily rolling file appender myself, so let me know what you are looking for so I can try to provide that as well.

Yeah.....I'm going to need you to go ahead and come in on Saturday.....Yeah.....That'd be great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top