<?xml version="1.0" encoding="utf-8" ?>
<!--

 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.

-->


<!-- .NET application configuration file

     The .NET Compact Framework does not support application configuration files,
     but log4net supports using configuration files with similar names and structure,
     to store the log4net configuration.
 -->

<configuration>
	<!-- This section contains the log4net configuration settings -->
	<log4net>

		<!-- Define some output appenders -->
		
		<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
			<file value="rolling-log.txt" />
			<appendToFile value="true" />

			<maxSizeRollBackups value="10" />
			<maximumFileSize value="100" />
			<rollingStyle value="Size" />
			<staticLogFileName value="true" />

			<layout type="log4net.Layout.PatternLayout">
				<header value="[Header]&#13;&#10;"/>
				<footer value="[Footer]&#13;&#10;"/>
				<conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
			</layout>
		</appender>
		
		<appender name="LogFileAppender" type="log4net.Appender.FileAppender" >
			<file value="log-file.txt" />
			
			<!-- Example using environment variables in params -->
			<!-- <file value="${TMP}\log-file.txt" /> -->
			<appendToFile value="true" />
			
			<!-- An alternate output encoding can be specified -->
			<!-- <encoding value="unicodeFFFE" /> -->

			<layout type="log4net.Layout.PatternLayout">
				<header value="[Header]&#13;&#10;"/>
				<footer value="[Footer]&#13;&#10;"/>
				<conversionPattern value="%date [%thread] %-5level %logger [%ndc] &lt;%property{auth}&gt; - %message%newline" />
			</layout>
			<!-- Alternate layout using XML
			<layout type="log4net.Layout.XMLLayout" /> -->
		</appender>

	    	<appender name="MulticastAppender" type="log4net.Appender.UdpAppender" >
			<threshold value="WARN" />
		    <remoteAddress value="224.0.0.1" />
		    <remotePort value="8080" />
		    <layout type="log4net.Layout.PatternLayout">
				<conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
		    </layout>
	    </appender>

 		<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
			<layout type="log4net.Layout.PatternLayout">
				<conversionPattern value="%date [%thread] %-5level %logger [%ndc] &lt;%property{auth}&gt; - %message%newline" />
			</layout>
		</appender>
		
 		<!-- 
 		
 		<appender name="A" type="log4net.Appender.ForwardingAppender" >
			<threshold value="WARN"/>
			<appender-ref ref="ConsoleAppender" />
		</appender>
		
 		<appender name="B" type="log4net.Appender.ForwardingAppender" >
 			<filter type="log4net.Filter.LevelRangeFilter">
				<levelMin value="DEBUG"/>
				<levelMax value="INFO"/>
 			</filter>
			<appender-ref ref="ConsoleAppender" />
		</appender> 
		
		-->

		<!-- Setup the root category, add the appenders and set the default level -->
		
		<root>
			<level value="INFO" />
			<appender-ref ref="LogFileAppender" />
			<appender-ref ref="ConsoleAppender" />
			<appender-ref ref="MulticastAppender" />
			<!-- <appender-ref ref="A" /> -->
		</root>

		<!-- Specify the level for some specific categories -->
		
		<logger name="ConsoleApp.LoggingExample">
			<!-- <appender-ref ref="B" /> -->
			<level value="ALL" />
			<appender-ref ref="RollingLogFileAppender" />
		</logger>
		
	</log4net>

</configuration>
