nicko 2004/09/09 13:29:34
Modified: src GlobalContext.cs
Log:
Added the hostname to the GlobalContext.Properties
Revision Changes Path
1.3 +9 -0 logging-log4net/src/GlobalContext.cs
Index: GlobalContext.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/GlobalContext.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- GlobalContext.cs 2 Aug 2004 09:41:10 -0000 1.2
+++ GlobalContext.cs 9 Sep 2004 20:29:34 -0000 1.3
@@ -36,6 +36,10 @@
/// be included in the output of log messages. The <see
cref="log4net.Layout.PatternLayout"/>
/// supports selecting and outputing these properties.
/// </para>
+ /// <para>
+ /// By default the <c>log4net:HostName</c> property is set to the name
of
+ /// the current machine.
+ /// </para>
/// </remarks>
/// <example>
/// <code>
@@ -58,6 +62,11 @@
}
#endregion Private Instance Constructors
+
+ static GlobalContext()
+ {
+ Properties[log4net.Core.LoggingEvent.HostNameProperty]
= SystemInfo.HostName;
+ }
#region Public Static Properties