Table of Contents

Class LogEvent

Namespace
Dynamicweb.Logging.LogEvents
Assembly
Dynamicweb.Logging.dll
public class LogEvent
Inheritance
LogEvent
Inherited Members

Constructors

LogEvent()

Creates a new prefilled LogEvent.
public LogEvent()

LogEvent(string, Exception)

Creates a LogEvent based upon the given exception. Logs the exception details to disk.
public LogEvent(string category, Exception ex)

Parameters

category string
ex Exception
Exception that requires a logevent

LogEvent(string, string, string)

Creates a LogEvent based upon an action and a description.
public LogEvent(string category, string description, string action = null)

Parameters

category string
The current action performed by the program
description string
Description of what is happening
action string
Subsection of a specific area of actions

Properties

Action

Gets or sets the action type.
public string Action { get; set; }

Property Value

string

Category

Gets or sets the category type.
public string Category { get; set; }

Property Value

string

CreateDate

Gets the Create date (local time).
public DateTime CreateDate { get; }

Property Value

DateTime

Description

Gets or sets the description.
public string Description { get; set; }

Property Value

string

ExceptionType

Gets the type of the exception.
public string ExceptionType { get; set; }

Property Value

string

FileLogPath

Gets the path to the logfile.
public string FileLogPath { get; }

Property Value

string

Id

Gets or sets the identifier.
public int Id { get; set; }

Property Value

int

Level

Level of the logged event.
public LogLevel Level { get; set; }

Property Value

LogLevel

MachineName

Gets the name of the machine that created the logevent.
public string MachineName { get; set; }

Property Value

string

Url

Request url if any was available during logevent
public string Url { get; set; }

Property Value

string

UserId

Id of user.
public int UserId { get; set; }

Property Value

int

UserName

Name of user at logtime.
public string UserName { get; set; }

Property Value

string

UtcOffset

Utc offset.
public TimeSpan UtcOffset { get; set; }

Property Value

TimeSpan

Methods

GetFriendlyDateOffset()

public string GetFriendlyDateOffset()

Returns

string

GetLogFileContent()

Gets the content of the logfile.
public string GetLogFileContent()

Returns

string
logFileContent

GetLogger()

Gets the logger for this object.
public ILogger GetLogger()

Returns

ILogger
logger

SetCreateDate(DateTime)

Sets the log date and the UTC offset.
[Obsolete("Do not use this.")]
public void SetCreateDate(DateTime time)

Parameters

time DateTime
UTC time.

SetCreateDate(DateTime, bool)

Sets the log create date and the UTC offset.
public void SetCreateDate(DateTime date, bool isUtcDate)

Parameters

date DateTime
The create date.
isUtcDate bool
Determines whether the date is UTC or local.

SetExceptionType(Exception)

public void SetExceptionType(Exception ex)

Parameters

ex Exception

SetFileLogPath(string)

Sets the path to the logfile for this object.
public void SetFileLogPath(string relativePath)

Parameters

relativePath string
Relative path to logfile
To top