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
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
Category
Gets or sets the category type.
public string Category { get; set; }
Property Value
CreateDate
Gets the Create date (local time).
public DateTime CreateDate { get; }
Property Value
Description
Gets or sets the description.
public string Description { get; set; }
Property Value
ExceptionType
Gets the type of the exception.
public string ExceptionType { get; set; }
Property Value
FileLogPath
Gets the path to the logfile.
public string FileLogPath { get; }
Property Value
Id
Gets or sets the identifier.
public int Id { get; set; }
Property Value
Level
Level of the logged event.
public LogLevel Level { get; set; }
Property Value
MachineName
Gets the name of the machine that created the logevent.
public string MachineName { get; set; }
Property Value
Url
Request url if any was available during logevent
public string Url { get; set; }
Property Value
UserId
Id of user.
public int UserId { get; set; }
Property Value
UserName
Name of user at logtime.
public string UserName { get; set; }
Property Value
UtcOffset
Utc offset.
public TimeSpan UtcOffset { get; set; }
Property Value
Methods
GetFriendlyDateOffset()
public string GetFriendlyDateOffset()
Returns
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
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