2

I am using log4net to generate logs in my applicaiton. My requirement was to generate logs every minute. I have achieved this using RollingMode.Date. These files are named like: name.log.yyyyMMdd-HHmm. But my requirement is to generate the files with name like: name.log.n where n will be sequential number. Any help??

1 Answer 1

3

I looked at the source code of RollingFileAppender and it seems that CountDirection=1 might be want you want.
If this does not work, I guess you need to write your own appender inheriting from RollingFileAppender which implements its own RollOverRenameFiles.

Sign up to request clarification or add additional context in comments.

1 Comment

I did exaclty that. Got the source code and edited the code so as to get the name of the output file in the desired format. Thanks for your help. :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.