I use Log4Net in my application. I need to create a configuration that "deposits" everything that is from level="INFO" into a file and everything that is light="ERROR" in another file.
But even following the tutorials, they do not work. Look how I did below. Thanks in advance ...
<log4net>
<root name="LogFilesAll">
<level value="ERROR" />
<appender-ref ref="RollingFileErro"/>
<level value="INFO" />
<appender-ref ref="RollingFileInfo"/>
<level value="DEBUG" />
<appender-ref ref="Console"/>
</root>
<!-- APPENDER DE ERRO -->
<appender name="RollingFileErro" type="log4net.Appender.RollingFileAppender">
<file value="GestorReq32Error.log" />
<appendToFile value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %date{dd/MM/yyyy HH:mm:ss} %message%newline" />
</layout>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<appendToFile value="true"/>
<maximumFileSize value="15MB"/>
<staticLogFileName value="true"/>
<rollingStyle value="Size"/>
<maxSizeRollBackups value="10"/>
</appender>
<!-- APPENDER DE ERRO -->
<appender name="RollingFileInfo" type="log4net.Appender.RollingFileAppender">
<file value="GestorReq32Info.log" />
<appendToFile value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %date{dd/MM/yyyy HH:mm:ss} %message%newline" />
</layout>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<appendToFile value="true"/>
<maximumFileSize value="15MB"/>
<staticLogFileName value="true"/>
<rollingStyle value="Size"/>
<maxSizeRollBackups value="10"/>
</appender>
<appender name="Console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" />
</layout>
</appender>
</log4net>