This is my log4net config file
<?xml version="1.0" encoding="utf-8" ?>
<log4net debug="true">
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
<filter type="log4net.Filter.LevelRangeFilter">
<acceptOnMatch value="true" />
<levelMin value="DEBUG" />
<levelMax value="FATAL" />
</filter>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %5rms [%-17.17t] %-22.22c{1} %-18.18M - %m%n" />
</layout>
</appender>
<appender name="SmtpAppender" type="MySmtpClientSmtpAppender">
<to value="[email protected]" />
<from value="[email protected]" />
<subject value="Game Server Monitoring Failed!" />
<smtpHost value="smtp.x.com" />
<username value="admin" />
<password value="x" />
<bufferSize value="256" />
<lossy value="true" />
<evaluator type="log4net.spi.LevelEvaluator">
<threshold value="ERROR" />
</evaluator>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %d [ThreadId: %t] Class:%c{1} Method:%M %nMESSAGE:%n%m%n%n" />
</layout>
</appender>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Logs\\wwwlog" />
<appendToFile value="true" />
<datePattern value="yyyyMMdd" />
<maximumFileSize value="10MB" />
<!--<rollingStyle value="Date" />-->
<filter type="log4net.Filter.LevelRangeFilter">
<acceptOnMatch value="true" />
<levelMin value="INFO" />
<levelMax value="FATAL" />
</filter>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="ConsoleAppender" />
<appender-ref ref="MySmtpAppender" />
<appender-ref ref="RollingLogFileAppender" />
</root>
</log4net>
Am I missing anything? Any tips/ advice to decrease log size while maintaining clarity, better conversion patterns? Any interesting hacks?
Edit: XMl file didnt get into the code block.Updating. Any sugggestions?