<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>


  <log4net>    
    <appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
      <target value="Console.Error" />
      <mapping>
        <level value="FATAL" />
        <foreColor value="Red" />
        <backColor value="White" />
      </mapping>
      <mapping>
        <level value="ERROR" />
        <foreColor value="Red, HighIntensity" />
      </mapping>
      <mapping>
        <level value="WARN" />
        <foreColor value="Yellow" />
      </mapping>
      <mapping>
        <level value="INFO" />
        <foreColor value="White" />
      </mapping>
      <mapping>
        <level value="DEBUG" />
        <foreColor value="Green" />
      </mapping>

      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %-5level - %message%newline" />
      </layout>
    </appender>


    <appender type="log4net.Appender.RollingFileAppender" name="RollingFileAppender">
      <threshold value="INFO" />
      <file value="logs\WeighsoftMobileMessageServer" />
      <appendToFile value="true" />
      <param name="StaticLogFileName" value="false" />
      <param name="DatePattern" value=".yyyy-MM-dd-HH.lo\g" />
      <param name="RollingStyle" value="Date" />
      <layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%date %-5level - %message%newline"/>
		</layout>
    </appender>


	  <appender type="log4net.Appender.RollingFileAppender" name="EventsAppender">
		  <file value="logs\events\events" />
		  <appendToFile value="true" />
		  <param name="StaticLogFileName" value="false" />
		  <param name="DatePattern" value=".yyyy-MM-dd.lo\g" />
		  <layout type="log4net.Layout.PatternLayout">
			  <conversionPattern value="%date %-5level - %message%newline"/>
		  </layout>
	  </appender>

	  <appender type="log4net.Appender.RollingFileAppender" name="ErrorsAppender">
		  <file value="logs\errors\errors" />
		  <appendToFile value="true" />
		  <param name="StaticLogFileName" value="false" />
		  <param name="DatePattern" value=".yyyy-MM-dd.lo\g" />
		  <layout type="log4net.Layout.PatternLayout">
			  <conversionPattern value="%date %-5level - %message%newline"/>
		  </layout>
	  </appender>

	  <appender type="log4net.Appender.RollingFileAppender" name="SecurityAppender">
		  <file value="logs\security\security" />
		  <appendToFile value="true" />
		  <param name="StaticLogFileName" value="false" />
		  <param name="DatePattern" value=".yyyy-MM-dd.lo\g" />
		  <layout type="log4net.Layout.PatternLayout">
			  <conversionPattern value="%date %-5level - %message%newline"/>
		  </layout>
	  </appender>
           
    <!-- Log messages to the usual log file. -->
    <logger name="WeighsoftMobileMessageServer">
      <appender-ref ref="ColoredConsoleAppender">
        <threshold value="ALL" />
      </appender-ref>

      <appender-ref ref="RollingFileAppender">
        <threshold value="INFO" />
      </appender-ref>          

    </logger>
  </log4net>

	<logger name="Events">
		<level value="All" />
		<appender-ref ref="EventsAppender" />
	</logger>

	<logger name="Errors">
		<level value="All" />
		<appender-ref ref="ErrorsAppender" />
	</logger>

	<logger name="Security">
		<level value="All" />
		<appender-ref ref="SecurityAppender" />
	</logger>


</configuration>