Class LogEvent
Details about a specific log event.
Inheritance
System.Object
LogEvent
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class LogEvent : object
Constructors
LogEvent(DateTime, String, String, LogLevel, String, Exception, Int64)
Initializes a new instance of the LogEvent class.
Declaration
public LogEvent(DateTime timestamp, string tag, string scope, LogLevel level, string message, Exception exception, long threadId)
Parameters
Type | Name | Description |
---|---|---|
DateTime | timestamp | The event timestamp. |
System.String | tag | The event tag. |
System.String | scope | The event scope. |
LogLevel | level | The event level. |
System.String | message | The event message. |
Exception | exception | The event exception, if one exists. |
System.Int64 | threadId | The ID of the thread generating the event. |
Properties
Exception
Gets or sets the event exception, if one exists.
Declaration
public Exception Exception { get; set; }
Property Value
Type | Description |
---|---|
Exception |
Level
Gets or sets the event level.
Declaration
public LogLevel Level { get; set; }
Property Value
Type | Description |
---|---|
LogLevel |
LogLevel
Gets the level of this log event. Alias for Level.
Declaration
public LogLevel LogLevel { get; }
Property Value
Type | Description |
---|---|
LogLevel |
Message
Gets or sets the event message.
Declaration
public string Message { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Scope
Gets or sets the event scope.
Declaration
public string Scope { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Tag
Gets or sets the event tag.
Declaration
public string Tag { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ThreadId
Gets or sets the ID of the thread generating the event.
Declaration
public long ThreadId { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
Timestamp
Gets or sets the event timestamp.
Declaration
public DateTime Timestamp { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
Methods
FromJson(String)
Deserializes a log event from JSON.
Declaration
public static LogEvent FromJson(string logEventJson)
Parameters
Type | Name | Description |
---|---|---|
System.String | logEventJson | The log event JSON. |
Returns
Type | Description |
---|---|
LogEvent |
ToJson()
Serializes this instance to JSON.
Declaration
public string ToJson()
Returns
Type | Description |
---|---|
System.String |
ToJson(LogEvent)
Serializes a log event to JSON.
Declaration
public static string ToJson(LogEvent logEvent)
Parameters
Type | Name | Description |
---|---|---|
LogEvent | logEvent | The log event. |
Returns
Type | Description |
---|---|
System.String |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |