<?xml version="1.0" ?>
<!--
Copyright 2004-2005 The Apache Software Foundation

Licensed 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.
-->
<document>

	<properties>
		<author email="nicko at apache dot org">Nicko Cadell</author>
		<title>log4net Features</title>
	</properties>

	<meta name="keywords" content="log4net features, log4net" />

	<body>
		<section name="log4net Features">
		
			<sectionMenu name="Contents" />

			<section name="Overview">
				<p>
					log4net is a tool to help the programmer output log statements to a 
					variety of output targets. In case of problems with an application, 
					it is helpful to enable logging so that the problem can be located. 
					With log4net it is possible to enable logging at runtime without 
					modifying the application binary. The log4net package is designed so 
					that log statements can remain in shipped code without incurring a 
					high performance cost. It follows that the speed of logging (or 
					rather not logging) is crucial.
				</p>
				<p>
					At the same time, log output can be so voluminous that it quickly becomes 
					overwhelming. One of the distinctive features of log4net is the notion of 
					hierarchical loggers. Using these loggers it is possible to selectively 
					control which log statements are output at arbitrary granularity. 
				</p>
				<p>
					log4net is designed with two distinct goals in mind: speed and flexibility
				</p>
			</section>
			
			<section name="Features">
				<ul>
					<li><h3>Support for multiple frameworks</h3></li>
					<li><h3>Output to multiple logging targets</h3></li>
					<li><h3>Hierarchical logging architecture</h3></li>
					<li><h3>XML Configuration</h3></li>
					<li><h3>Dynamic Configuration</h3></li>
					<li><h3>Logging Context</h3></li>
					<li><h3>Proven architecture</h3></li>
					<li><h3>Modular and extensible design</h3></li>
					<li><h3>High performance with flexibility</h3></li>
				</ul>
			</section>

			<section name="Support for multiple frameworks">
				<p>
					log4net supports the following frameworks:
				</p>
				<ul>
					<li>Microsoft .NET Framework 1.0 (1.0.3705)</li>
					<li>Microsoft .NET Framework 1.1 (1.1.4322)</li>
					<li>Microsoft .NET Compact Framework 1.0 (1.0.5000)</li>
					<li>Mono 1.0</li>
					<li>Microsoft Shared Source CLI 1.0</li>
					<li>CLI 1.0 Compatible</li>
				</ul>
			</section>

			<section name="Output to multiple logging targets">
				<p>
					log4net ships with the following appenders (not on all frameworks):
				</p>
				<div class="table">
					<table cellspacing="0">
						<tr>
							<th>
								Type</th>
							<th>
								Description</th>
						</tr>
						<tr>
							<td>log4net.Appender.AdoNetAppender</td>
							<td>
								Writes logging events to a database using either prepared statements or stored 
								procedures.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.AnsiColorTerminalAppender</td>
							<td>
								Writes color highlighted logging events to a an ANSI terminal window.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.AspNetTraceAppender</td>
							<td>
								Writes logging events to the ASP trace context. These can then be rendered at 
								the end of the ASP page or on the ASP trace page.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.ColoredConsoleAppender</td>
							<td>
								Writes color highlighted logging events to the application's Windows Console.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.ConsoleAppender</td>
							<td>
								Writes logging events to the application's Console. The events may go to either 
								the standard our stream or the standard error stream.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.EventLogAppender</td>
							<td>
								Writes logging events to the Windows Event Log.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.FileAppender</td>
							<td>
								Writes logging events to a file in the file system.
							</td>
						</tr>
						<tr>
							<td>log4net.LocalSyslogAppender</td>
							<td>
								Writes logging events to the local syslog service (UNIX only).
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.MemoryAppender</td>
							<td>
								Stores logging events in an in memory buffer.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.NetSendAppender</td>
							<td>
								Writes logging events to the Windows Messenger service. These messages are 
								displayed in a dialog on a users terminal.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.OutputDebugStringAppender</td>
							<td>
								Writes logging events to the debugger. If the application has no 
								debugger, the system debugger displays the string. If the application has no 
								debugger and the system debugger is not active, the message is ignored.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.RemoteSyslogAppender</td>
							<td>
								Writes logging events to a remote syslog service using UDP networking.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.RemotingAppender</td>
							<td>
								Writes logging events to a remoting sink using .NET remoting.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.RollingFileAppender</td>
							<td>
								Writes logging events to a file in the file system. The RollingFileAppender can 
								be configured to log to multiple files based upon date or file size 
								constraints.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.SmtpAppender</td>
							<td>
								Sends logging events to an email address.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.TelnetAppender</td>
							<td>
								Clients connect via Telnet to receive logging events.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.TraceAppender</td>
							<td>
								Writes logging events to the .NET trace system.
							</td>
						</tr>
						<tr>
							<td>log4net.Appender.UdpAppender</td>
							<td>
								Sends logging events as connectionless UDP datagrams to a remote host or a 
								multicast group using a UdpClient.
							</td>
						</tr>
					</table>
				</div>
				<p />
			</section>

			<section name="Hierarchical logging architecture">
				<p>
					Hierarchical logging is an ideal fit with component based development. 
					Each component has its own of logger. When individually tested, the 
					properties of these loggers may be set as the developer requires. 
					When combined with other components, the loggers inherit the properties 
					determined by the integrator of the components. One can selectively elevate 
					logging priorities on one component without affecting the other components. 
					This is useful when you need a detailed trace from just a single component 
					without crowding the trace file with messages from other components. All 
					this can be done through configuration files; no code changes are required. 			
				</p>
			</section>

			<section name="XML Configuration">
				<p>
					log4net is configured using an XML configuration file. The configuration 
					information can be embedded within other XML configuration files
					(such as the application's .config file) or in a separate file. The
					configuration is easily readable and updateable while retaining the
					flexibility to express all configurations.
				</p>
				<p>
					Alternatively log4net can be configured programmatically.
				</p>
			</section>

			<section name="Dynamic Configuration">
				<p>
					log4net can monitor its configuration file for changes and dynamically
					apply changes made by the configurator. The logging levels, appenders, 
					layouts, and just about everything else can be adjusted at runtime. 
					In many cases it is possible to diagnose application issues without 
					terminating the process in question. This can a very valuable tool in
					investigating issues with deployed applications.
				</p>
			</section>

			<section name="Logging Context">
				<p>
					log4net can collect logging context data in a way that is transparent 
					to the developer at the point of logging. The GlobalContext and the 
					ThreadContext allow the application to capture contextual data and for it
					to be attached to logging messages. For instance, in a web service, 
					once the caller is authenticated the username of the caller is can be 
					stored in a ThreadContext property. This property is then automatically 
					logged as part of each logging message.
				</p>
			</section>

			<section name="Proven architecture">
				<p>
					log4net is based on the highly successful log4j logging library,
					in development since 1996. This popular and proven architecture has 
					so far been ported to 12 languages.
				</p>
			</section>
			
		</section>
	</body>
</document>
