1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//w3c//dtd xhtml 1.1 strict//en" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
5
<link href="style.css" type="text/css" rel="STYLESHEET" />
6
<title>log4net - Framework Support</title>
9
<div id="header"><h1>log4net - Framework Support</h1>
12
<h2>Summary of .NET frameworks supported by log4net</h2>
15
log4net now builds on 5 frameworks:
18
<table cellspacing="0">
20
<col style="text-align: left; white-space: nowrap" />
21
<col style="text-align: left;" />
29
<tr style="vertical-align: top;">
30
<td>Microsoft .Net Framework 1.0 (1.0.3705)</td>
31
<td><a href="http://msdn.microsoft.com/net">http://msdn.microsoft.com/net</a></td>
33
<tr style="vertical-align: top;">
34
<td>Microsoft .Net Framework 1.1 (1.1.4322)</td>
35
<td><a href="http://msdn.microsoft.com/net">http://msdn.microsoft.com/net</a></td>
37
<tr style="vertical-align: top;">
38
<td>Microsoft .Net Compact Framework 1.0 (1.0.5000)</td>
39
<td><a href="http://msdn.microsoft.com/vstudio/device/compactfx.asp">http://msdn.microsoft.com/vstudio/device/compactfx.asp</a></td>
41
<tr style="vertical-align: top;">
42
<td>Mono 0.25 or higher</td>
43
<td><a href="http://www.go-mono.org">http://www.go-mono.org</a></td>
45
<tr style="vertical-align: top;">
46
<td>Microsoft Shared Source CLI 1.0</td>
47
<td><a href="http://msdn.microsoft.com/library/en-us/dndotnet/html/mssharsourcecli.asp">http://msdn.microsoft.com/library/en-us/dndotnet/html/mssharsourcecli.asp</a></td>
52
For each of these frameworks, an assembly targeting that the framework is supplied. Although it's
53
perfectly possible to use the .NET Framework 1.0 version of log4net on the .NET Framework 1.1, having
54
an assembly that really targets a specific framework allows us to use features in that framework that
55
are not available in other frameworks or remove features from log4net that are not supported in a
62
The appenders available to each framework depend on the functionality of the
63
framework and the platform it runs on:
66
<table cellspacing="0">
68
<col style="text-align: left;" />
69
<col style="text-align: center;" />
70
<col style="text-align: center;" />
71
<col style="text-align: center;" />
72
<col style="text-align: center;" />
73
<col style="text-align: center;" />
79
.NET Framework 1.0</th>
81
.NET Framework 1.1</th>
83
.NET Compact Framework 1.0</th>
85
Mono 0.25 or higher</th>
87
Shared Source CLI 1.0</th>
90
<td>ADONetAppender</td>
98
<td>ASPNetTraceAppender</td>
106
<td>BufferingForwardingAppender</td>
114
<td>ColoredConsoleAppender</td>
122
<td>ConsoleAppender</td>
130
<td>CountingAppender</td>
138
<td>EventLogAppender</td>
146
<td>FileAppender</td>
154
<td>ForwardingAppender</td>
162
<td>MemoryAppender</td>
170
<td>NetSendAppender</td>
178
<td>OutputDebugStringAppender</td>
186
<td>RemotingAppender</td>
194
<td>RollingFileAppender</td>
202
<td>SMTPAppender</td>
210
<td>SmtpPickupDirAppender</td>
218
<td>TraceAppender</td>
236
<h2>Framework Specific Notes</h2>
238
<h3>Microsoft .Net Framework 1.0 (1.0.3705)</h3>
244
<h3>Microsoft .Net Framework 1.1 (1.1.4322)</h3>
250
<h3>Microsoft .Net Compact Framework 1.0 (1.0.5000)</h3>
254
<h4>Assembly attributes</h4>
256
The .NET Compact Framework 1.0 does not support retrieving assembly-level
257
attributes, therefore all log4net configuration attributes were removed from
258
the .NET Compact Framework 1.0 version of log4net.
261
For Smart-device applications, the log4net system can be configured by passing
262
the location of the log4net configuration file to the
263
<span class="code">log4net.Config.DOMConfigurator.Configure(FileInfo)</span>
264
method in the entry point of the application.
273
public class EntryPoint
276
/// Application entry point.
278
public static void Main()
280
// Uncomment the next line to enable log4net internal debugging
281
// log4net.helpers.LogLog.InternalDebugging = true;
283
// This will instruct log4net to look for a configuration file
284
// called config.log4net in the root directory of the device
285
log4net.Config.DOMConfigurator.Configure(new FileInfo(@"\config.log4net"));
289
// This will shutdown the log4net system
290
log4net.LogManager.Shutdown();
297
<h4>Notification events</h4>
299
The .NET Compact Framework 1.0 does not support notification events during the
300
application shutdown, therefore log4net cannot automatically hook the
301
application shutdown notification.
304
Applications will need to programmatically shutdown the log4net system during
305
the application's shutdown using the
306
<span class="code">log4net.LogManager.Shutdown()</span>
307
method in order to prevent losing logging events.
308
See the code above for an example.
312
<h4>FileSystemWatcher</h4>
314
The .NET Compact Framework 1.0 does not support the
315
<span class="code">System.IO.FileSystemWatcher</span>
316
class. As a result, the
317
<span class="code">DOMConfiguratorAttribute.Watch</span>
319
<span class="code">DOMConfigurator.ConfigureAndWatch</span>
320
methods are not available. Watching changes to the log4net configuration
321
file is not supported on the .NET Compact Framework 1.0.
327
The .NET Compact Framework 1.0 does not support the
328
<span class="code">System.Security.Principal.WindowsIdentity</span> class.
329
This is used to capture the current thread's user identity. Therefore
330
the <span class="code">LoggingEvent.UserName</span> property will return the value
331
<span class="code">"NOT AVAILABLE"</span>.
337
The .NET Compact Framework 1.0 does not support the
338
<span class="code">System.Security.Principal.IPrincipal</span> interface.
339
This is used to capture the current thread's user identity. Therefore
340
the <span class="code">LoggingEvent.Identity</span> property will return the value
341
<span class="code">"NOT AVAILABLE"</span>.
345
<h4>Environment variables</h4>
347
The .NET Compact Framework 1.0 does not support retrieving environment
348
variables, therefore it's not possible to substitute environment variables in
349
parameter values when using the .NET Compact Framework 1.0 version of log4net.
353
<h4>Serialization</h4>
355
The .NET Compact Framework 1.0 does not support serialization, therefore none of
356
the log4net classes in the .NET Compact Framework 1.0 version are serializable.
360
<h4>LoggingEvent.Domain</h4>
362
The .NET Compact Framework 1.0 does not support AppDomain functionality. The
363
friendly name for the current AppDomain is stored in the <span class="code">LoggingEvent.Domain</span>
364
property and is accessed using the <span class="code">%a</span> pattern of the
365
<span class="code">PatternLayout</span>. On the .NET Compact Framework 1.0 this
366
value is generated by taking the file name for the application's primary module.
371
<h3>Mono 0.25 or higher</h3>
377
<h3>Microsoft Shared Source CLI 1.0</h3>
381
<h4>FileSystemWatcher</h4>
383
SSCLI 1.0 does not support the
384
<span class="code">System.IO.FileSystemWatcher</span>
385
class. As a result, the
386
<span class="code">DOMConfiguratorAttribute.Watch</span>
388
<span class="code">DOMConfigurator.ConfigureAndWatch</span>
389
methods are not available. Watching changes to the log4net configuration
390
file is not supported on SSCLI 1.0.
396
SSCLI 1.0 does not support the
397
<span class="code">System.Security.Principal.WindowsIdentity</span> class.
398
This is used to capture the current thread's user identity. Therefore
399
the <span class="code">LoggingEvent.UserName</span> property will return the value
400
<span class="code">"NOT AVAILABLE"</span>.
406
SSCLI 1.0 does not support the
407
<span class="code">System.Security.Principal.IPrincipal</span> interface.
408
This is used to capture the current thread's user identity. Therefore
409
the <span class="code">LoggingEvent.Identity</span> property will return the value
410
<span class="code">"NOT AVAILABLE"</span>.
417
<div id="footer">Copyright (C) 2001-2003 Neoworks Limited. All Rights Reserved.</div>