Class LogMessageReceivedEventArgs
Event arguments representing the message that is logged on to the terminal. Use the properties to forward the data to your logger of choice.
Namespace: Swan.Logging
Syntax
public class LogMessageReceivedEventArgs : EventArgs
Constructors
LogMessageReceivedEventArgs(UInt64, LogLevel, DateTime, String, String, Object, String, String, Int32)
Initializes a new instance of the LogMessageReceivedEventArgs class.
Declaration
public LogMessageReceivedEventArgs(ulong sequence, LogLevel messageType, DateTime utcDate, string source, string message, object extendedData, string callerMemberName, string callerFilePath, int callerLineNumber)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | sequence | The sequence. |
LogLevel | messageType | Type of the message. |
DateTime | utcDate | The UTC date. |
String | source | The source. |
String | message | The message. |
Object | extendedData | The extended data. |
String | callerMemberName | Name of the caller member. |
String | callerFilePath | The caller file path. |
Int32 | callerLineNumber | The caller line number. |
Properties
CallerFilePath
Gets the caller file path.
Declaration
public string CallerFilePath { get; }
Property Value
Type | Description |
---|---|
String | The caller file path. |
CallerLineNumber
Gets the caller line number.
Declaration
public int CallerLineNumber { get; }
Property Value
Type | Description |
---|---|
Int32 | The caller line number. |
CallerMemberName
Gets the name of the caller member.
Declaration
public string CallerMemberName { get; }
Property Value
Type | Description |
---|---|
String | The name of the caller member. |
Exception
Gets the Extended Data properties cast as an Exception (if possible) Otherwise, it return null.
Declaration
public Exception? Exception { get; }
Property Value
Type | Description |
---|---|
Nullable<Exception> | The exception. |
ExtendedData
Gets an object representing extended data. It could be an exception or anything else.
Declaration
public object ExtendedData { get; }
Property Value
Type | Description |
---|---|
Object | The extended data. |
Message
Gets the body of the message.
Declaration
public string Message { get; }
Property Value
Type | Description |
---|---|
String | The message. |
MessageType
Gets the type of the message. It can be a combination as the enumeration is a set of bitwise flags.
Declaration
public LogLevel MessageType { get; }
Property Value
Type | Description |
---|---|
LogLevel | The type of the message. |
Sequence
Gets logging message sequence.
Declaration
public ulong Sequence { get; }
Property Value
Type | Description |
---|---|
UInt64 | The sequence. |
Source
Gets the name of the source where the logging message came from. This can come empty if the logger did not set it.
Declaration
public string Source { get; }
Property Value
Type | Description |
---|---|
String | The source. |
UtcDate
Gets the UTC date at which the event at which the message was logged.
Declaration
public DateTime UtcDate { get; }
Property Value
Type | Description |
---|---|
DateTime | The UTC date. |