LoggingEvent ClassApache log4net™ SDK Documentation
The internal representation of logging events.
Inheritance Hierarchy

SystemObject
  log4net.CoreLoggingEvent

Namespace: log4net.Core
Assembly: log4net (in log4net.dll) Version: 2.0.6.0-.NET 4.0
Syntax

[SerializableAttribute]
public class LoggingEvent : ISerializable

The LoggingEvent type exposes the following members.

Constructors

  NameDescription
Public methodLoggingEvent(LoggingEventData)
Initializes a new instance of the LoggingEvent class using specific data.
Protected methodLoggingEvent(SerializationInfo, StreamingContext)
Serialization constructor
Public methodLoggingEvent(Type, ILoggerRepository, LoggingEventData)
Initializes a new instance of the LoggingEvent class using specific data.
Public methodLoggingEvent(Type, ILoggerRepository, LoggingEventData, FixFlags)
Initializes a new instance of the LoggingEvent class using specific data.
Public methodLoggingEvent(Type, ILoggerRepository, String, Level, Object, Exception)
Initializes a new instance of the LoggingEvent class from the supplied parameters.
Top
Properties

  NameDescription
Public propertyDomain
Gets the AppDomain friendly name.
Public propertyExceptionObject
Gets the exception object used to initialize this event.
Public propertyFix
The fixed fields in this event
Public propertyIdentity
Gets the identity of the current thread principal.
Public propertyLevel
Gets the Level of the logging event.
Public propertyLocationInformation
Gets the location information for this logging event.
Public propertyLoggerName
Gets the name of the logger that logged the event.
Public propertyMessageObject
Gets the message object used to initialize this event.
Public propertyProperties
Additional event specific properties.
Public propertyRenderedMessage
Gets the message, rendered through the RendererMap.
Public propertyRepository
The ILoggerRepository that this event was created in.
Public propertyStatic memberStartTime
Gets the time when the current process started.
Public propertyStatic memberStartTimeUtc
Gets the UTC time when the current process started.
Public propertyThreadName
Gets the name of the current thread.
Public propertyTimeStamp
Gets the time of the logging event.
Public propertyTimeStampUtc
Gets UTC the time of the logging event.
Public propertyUserName
Gets the name of the current user.
Top
Methods

  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFixVolatileData Obsolete.
Fix instance fields that hold volatile data.
Public methodFixVolatileData(Boolean) Obsolete.
Fixes instance fields that hold volatile data.
Protected methodFixVolatileData(FixFlags)
Fix the fields specified by the FixFlags parameter
Public methodGetExceptionString
Returns this event's exception's rendered using the RendererMap.
Public methodGetExceptionStrRep Obsolete.
Returns this event's exception's rendered using the RendererMap.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLoggingEventData
Gets the portable data for this LoggingEvent.
Public methodGetLoggingEventData(FixFlags)
Gets the portable data for this LoggingEvent.
Public methodGetObjectData
Serializes this object into the SerializationInfo provided.
Public methodGetProperties
Get all the composite properties in this event
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLookupProperty
Lookup a composite property in this event
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodWriteRenderedMessage
Write the rendered message to a TextWriter
Top
Fields

  NameDescription
Public fieldStatic memberHostNameProperty
The key into the Properties map for the host name value.
Public fieldStatic memberIdentityProperty
The key into the Properties map for the thread identity value.
Public fieldStatic memberUserNameProperty
The key into the Properties map for the user name value.
Top
Remarks

When an affirmative decision is made to log then a LoggingEvent instance is created. This instance is passed around to the different log4net components.

This class is of concern to those wishing to extend log4net.

Some of the values in instances of LoggingEvent are considered volatile, that is the values are correct at the time the event is delivered to appenders, but will not be consistent at any time afterwards. If an event is to be stored and then processed at a later time these volatile values must be fixed by calling [M:FixVolatileData()]. There is a performance penalty for incurred by calling [M:FixVolatileData()] but it is essential to maintaining data consistency.

See Also

Reference