I would like to combine both rolling time and rolling size in an appender, it seems there is no composite rolling in log4cxx, am I right ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, there isn’t. In fact, there is no such combined policy implemented in log4j, either, so it was not transferred to log4cxx.
I once had a task of writing such mixed-policy rolling file appender (in log4j, though). I did this by overriding
FileAppender, esp. the methodto continue logging to the appropriate log chunk after process restart, and
to test after every log entry whether the condition for rolling over is true.
A truly powerful feature of implementing your own appender in log4j/cxx is that you can define its properties in
log4j.propertiesand have them set by the library. In Java you get it for free, thanks to reflection; in log4cxx you only need to write yourmethod, where you iterate through option strings and perform necessary initialization actions.
Hope that helps and comes in the right time.