Bu ayar şu şekildedir:
log4net.config dosyası içeriği:
<?xml version="1.0"?>
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="App_Data\Logs\IKSoft.Management.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="RollingFileAppender" />
</root>
</log4net>
Kaynak:
http://logging.apache.org/log4net/release/sdk/log4net.Appender.RollingFileAppenderMembers.html
http://logging.apache.org/log4net/release/config-examples.html
Hiç yorum yok:
Yorum Gönder