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