开发者

Naming a file generated using Log4net

开发者 https://www.devze.com 2022-12-22 06:13 出处:网络
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

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开发者_如何学Python the files with name like: name.log.n where n will be sequential number. Any help??


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号