Currently my application is using log4net to log errors, the web.config for this is as followed:
<log4net>
<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="c:/paypal/logs/gateway.log" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] – %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="FileAppender" />
</root>
</log4net>
However, the problem with this is that everyday the logs always go to gateway.log
Does anybody know a way to have a different log file per day using log4net?
Ideally I don't want to have to manually edit the web.config
every night using a scheduled task.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…