<?xml version="1.0" encoding="utf-8" ?>
<!-- 
		.NET application configuration file     
		This file must have the exact same name as your application with .config appended to it. 
		
		For example if your application is ConsoleApp.exe then the config file must be ConsoleApp.exe.config. 
		It must also be in the same directory as the application. 
	-->
<configuration>
	<!-- Register a section handler for the log4net section -->
	<configSections>
		<section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
	</configSections>
	
	<appSettings>
		<!-- To enable internal log4net logging specify the following appSettings key -->
		<!-- <add key="log4net.Internal.Debug" value="true"/> -->
	</appSettings>
	
	<!-- This section contains the log4net configuration settings -->
	<log4net>

		<appender name="WmiAppender" type="log4net.Appender.WmiAppender,log4net.Appender.WmiAppender">
		</appender>

		<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
			<layout type="log4net.Layout.PatternLayout" value="%date [%thread] %-5level %logger - %message%newline" />
		</appender>
		
		<appender name="MessageBoxAppender" type="SampleAppendersApp.Appender.MessageBoxAppender, SampleAppendersApp">

			<layout type="log4net.Layout.PatternLayout" value="%date [%thread] %-5level %logger [%ndc] &lt;%property{auth}&gt; - %message%newline"/>
			<titleLayout type="log4net.Layout.PatternLayout" value="LoggingEvent: %-5level %logger"/>
			<mapping>
				<level value="ERROR" />
				<icon value="Error" />
			</mapping>
			
		</appender>
		
		
		<appender name="FireEventAppender" type="SampleAppendersApp.Appender.FireEventAppender, SampleAppendersApp">
		</appender>
		
		<appender name="SimpleSmtpAppender" type="SampleAppendersApp.Appender.SimpleSmtpAppender, SampleAppendersApp">
			<layout type="log4net.Layout.PatternLayout" value="%date [%thread] %-5level %logger - %message%newline" />
			<subject value="%-5level %logger" />
			
			<to value="you@me.co.uk" />
			<from value="me@me.co.uk" />
			<smtpHost value="my-smtp-server" /> 
		</appender>
		
		<appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
			<layout type="log4net.Layout.PatternLayout" value="%date [%thread] %-5level %logger - %properties%newline" />
			<mapping>
				<level value="DEBUG" />
				<backColor value="Blue" />
				<foreColor value="White" />
			</mapping>
		</appender>
		
		<appender name="MessageObjectExpanderAppender" type="SampleAppendersApp.Appender.MessageObjectExpanderAppender, SampleAppendersApp">
			<appender-ref ref="ColoredConsoleAppender" />
		</appender>
		
		<appender name="MsmqAppender" type="SampleAppendersApp.Appender.MsmqAppender, SampleAppendersApp">
			<queueName value=".\Private$\log-test" />
			<labelLayout value="LOG [%level] %date" />
			<layout type="log4net.Layout.PatternLayout" value="%date [%thread] %-5level %logger - %message%newline" />
		</appender>
		
		<appender name="AsyncConsoleAppender" type="SampleAppendersApp.Appender.AsyncAppender, SampleAppendersApp">
			<appender-ref ref="ColoredConsoleAppender" />
		</appender>
		
		<appender name="FastDbAppender" type="SampleAppendersApp.Appender.FastDbAppender, SampleAppendersApp">
			<connectionString value="Persist Security Info=False;Integrated Security=false;server=ate;database=log4net_test;Connect Timeout=30;User ID=sa;Password=sa" />
		</appender>
		
		<appender name="PatternFileAppender" type="SampleAppendersApp.Appender.PatternFileAppender, SampleAppendersApp">
			<!-- File pattern to group files by date, then by session property -->
			<file value="%date{yyyy-MM-dd}\%property{session}\output.log" />
			<layout type="log4net.Layout.PatternLayout" value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
		</appender>

		<!-- Setup the root category, add the appenders and set the default level -->
		<root>
			<level value="ALL" />
			
			<appender-ref ref="WmiAppender" />
			<appender-ref ref="PatternFileAppender" />
			<appender-ref ref="ConsoleAppender" />
			<appender-ref ref="MessageObjectExpanderAppender" />
			<appender-ref ref="MessageBoxAppender" />
			<appender-ref ref="FireEventAppender" />
			<appender-ref ref="SimpleSmtpAppender" />
			<appender-ref ref="MsmqAppender" />
			<appender-ref ref="AsyncConsoleAppender" />
			<appender-ref ref="FastDbAppender" />

		</root>
		
	</log4net>
</configuration>
