C# Class Serilog.Events.LogEvent

A log event.
Show file Open project: serilog/serilog Class Usage Examples

Public Methods

Method Description
AddOrUpdateProperty ( LogEventProperty property ) : void

Add a property to the event if not already present, otherwise, update its value.

AddPropertyIfAbsent ( LogEventProperty property ) : void

Add a property to the event if not already present.

LogEvent ( DateTimeOffset timestamp, LogEventLevel level, Exception exception, Serilog.Events.MessageTemplate messageTemplate, IEnumerable properties ) : System

Construct a new LogEvent.

RemovePropertyIfPresent ( string propertyName ) : void

Remove a property from the event, if present. Otherwise no action is performed.

RenderMessage ( IFormatProvider formatProvider = null ) : string

Render the message template given the properties associated with the event, and return the result.

RenderMessage ( TextWriter output, IFormatProvider formatProvider = null ) : void

Render the message template to the specified output, given the properties associated with the event.

Method Details

AddOrUpdateProperty() public method

Add a property to the event if not already present, otherwise, update its value.
public AddOrUpdateProperty ( LogEventProperty property ) : void
property LogEventProperty The property to add or update.
return void

AddPropertyIfAbsent() public method

Add a property to the event if not already present.
public AddPropertyIfAbsent ( LogEventProperty property ) : void
property LogEventProperty The property to add.
return void

LogEvent() public method

Construct a new LogEvent.
public LogEvent ( DateTimeOffset timestamp, LogEventLevel level, Exception exception, Serilog.Events.MessageTemplate messageTemplate, IEnumerable properties ) : System
timestamp DateTimeOffset The time at which the event occurred.
level LogEventLevel The level of the event.
exception System.Exception An exception associated with the event, or null.
messageTemplate Serilog.Events.MessageTemplate The message template describing the event.
properties IEnumerable Properties associated with the event, including those presented in .
return System

RemovePropertyIfPresent() public method

Remove a property from the event, if present. Otherwise no action is performed.
public RemovePropertyIfPresent ( string propertyName ) : void
propertyName string The name of the property to remove.
return void

RenderMessage() public method

Render the message template given the properties associated with the event, and return the result.
public RenderMessage ( IFormatProvider formatProvider = null ) : string
formatProvider IFormatProvider Supplies culture-specific formatting information, or null.
return string

RenderMessage() public method

Render the message template to the specified output, given the properties associated with the event.
public RenderMessage ( TextWriter output, IFormatProvider formatProvider = null ) : void
output System.IO.TextWriter The output.
formatProvider IFormatProvider Supplies culture-specific formatting information, or null.
return void