Table of Contents

Class LogEntry

Namespace
Tripous.Logging
Assembly
Tripous.Logging.dll

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

Source string
ScopeId string
EventId string
Level LogLevel
Exception Exception
Text string
Params Dictionary<string, object>

Properties

Date

Returns the UTC date this info created.

public string Date { get; }

Property Value

string

EventId

The event Id

public string EventId { get; }

Property Value

string

Exception

The exception if this is a log regarding an exception

public Exception Exception { get; }

Property Value

Exception

ExceptionData

The exception data, if this is a log regarding an exception

public string ExceptionData { get; }

Property Value

string

Host

The name of the local computer

public string Host { get; }

Property Value

string

Id

Id

public string Id { get; }

Property Value

string

Level

The log level

public LogLevel Level { get; }

Property Value

LogLevel

LevelText

The level as string

public string LevelText { get; }

Property Value

string

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

Dictionary<string, object>

ScopeId

The scope if any

public string ScopeId { get; }

Property Value

string

Source

The source of this log, if any

public string Source { get; }

Property Value

string

Text

The log message

public string Text { get; }

Property Value

string

Time

Returns the UTC time this info created.

public string Time { get; }

Property Value

string

TimeStamp

Returns the UTC date-time this info created

public DateTime TimeStamp { get; }

Property Value

DateTime

TimeStampText

The timestamp as string.

public string TimeStampText { get; }

Property Value

string

User

The username of the current user of this application or the local computer

public string User { get; set; }

Property Value

string

Methods

AsJson()

Returns a string representation of this entry.

public string AsJson()

Returns

string

AsLine()

Returns a string representation of this entry.

public string AsLine()

Returns

string

AsList()

Returns a string representation of this entry.

public string AsList()

Returns

string

GetPropertiesAsSingleLine()

Returns a string representation of the Properties property of this entry.

public string GetPropertiesAsSingleLine()

Returns

string

GetPropertiesAsTextList()

Returns a string representation of the Properties property of this entry.

public string GetPropertiesAsTextList()

Returns

string

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

Folder string

ToString()

Returns a string representation of this log info message.

public override string ToString()

Returns

string