Class LogEntry
Represents a log message
public class LogEntry
- Inheritance
-
LogEntry
- Inherited Members
- Extension Methods
Constructors
LogEntry(string, string, string, LogLevel, Exception, string, Dictionary<string, object>)
Constructor
public LogEntry(string Source, string ScopeId, string EventId, LogLevel Level, Exception Exception, string Text, Dictionary<string, object> Params = null)
Parameters
SourcestringScopeIdstringEventIdstringLevelLogLevelExceptionExceptionTextstringParamsDictionary<string, object>
Properties
Date
Returns the UTC date this info created.
public string Date { get; }
Property Value
EventId
The event Id
public string EventId { get; }
Property Value
Exception
The exception if this is a log regarding an exception
public Exception Exception { get; }
Property Value
ExceptionData
The exception data, if this is a log regarding an exception
public string ExceptionData { get; }
Property Value
Host
The name of the local computer
public string Host { get; }
Property Value
Id
Id
public string Id { get; }
Property Value
Level
The log level
public LogLevel Level { get; }
Property Value
LevelText
The level as string
public string LevelText { get; }
Property Value
Properties
A dictionary with params passed when the log message was formatted. For use by structured log listeners
public Dictionary<string, object> Properties { get; }
Property Value
ScopeId
The scope if any
public string ScopeId { get; }
Property Value
Source
The source of this log, if any
public string Source { get; }
Property Value
Text
The log message
public string Text { get; }
Property Value
Time
Returns the UTC time this info created.
public string Time { get; }
Property Value
TimeStamp
Returns the UTC date-time this info created
public DateTime TimeStamp { get; }
Property Value
TimeStampText
The timestamp as string.
public string TimeStampText { get; }
Property Value
User
The username of the current user of this application or the local computer
public string User { get; set; }
Property Value
Methods
AsJson()
Returns a string representation of this entry.
public string AsJson()
Returns
AsLine()
Returns a string representation of this entry.
public string AsLine()
Returns
AsList()
Returns a string representation of this entry.
public string AsList()
Returns
GetPropertiesAsSingleLine()
Returns a string representation of the Properties property of this entry.
public string GetPropertiesAsSingleLine()
Returns
GetPropertiesAsTextList()
Returns a string representation of the Properties property of this entry.
public string GetPropertiesAsTextList()
Returns
SaveToFile(string)
Saves this log info to the folder. The file name is constructed using the date and time information.
public void SaveToFile(string Folder = "")
Parameters
Folderstring
ToString()
Returns a string representation of this log info message.
public override string ToString()