Log4net滚动每日文件名,文件名中带有日期
问题描述:
我想为文件命名,例如:
I would like to have files named for example:
dd.mm.yyyy.log
dd.mm.yyyy.log
使用log4net怎么可能?
How is this possible with log4net?
答
在Log4net配置文件中,将以下参数与RollingFileAppender一起使用:
In your Log4net config file, use the following parameter with the RollingFileAppender:
<param name="DatePattern" value="dd.MM.yyyy'.log'" />