I'm using log4net to log write log message to a rolling log file.
Now I would also redirect all trace messages from System.Diagnostics.Trace
to that log file. How can I configure that? I tried to find anything about that in the log4net documentation, but without success. Is it possible at all?
The reason I want to do that is because I am interested in the Trace messages of a 3rd party library.
<log4net>
<appender name="R1" type="log4net.Appender.RollingFileAppender">
<file value="C:LogsMyService.log" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<maxSizeRollBackups value="10" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
</log4net>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…