1.首先先继承log4net.Appender.RollingFileAppender
2.PreAppendCheck()方法override添加调用标志
比如:
??????? protected override void OpenFile(string file, bool app)
??????? {
??????????? if (flag)
??????????? {
??????????????? base.OpenFile(file, app);
??????????? }
??????? }
3.OpenFile()方法override添加判断flag的值就ok了
比如:
?????? protected override void OpenFile(string fileName, bool append)
??????? {
??????????? if (fileFlag)
??????????? {
??????????????? base.OpenFile(fileName, append);
??????????? }
??????? }
?
?