C# Class Serilog.Events.LogEvent

A log event.
Afficher le fichier Open project: serilog/serilog Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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.
Résultat void

AddPropertyIfAbsent() public méthode

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

LogEvent() public méthode

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 .
Résultat System

RemovePropertyIfPresent() public méthode

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.
Résultat void

RenderMessage() public méthode

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.
Résultat string

RenderMessage() public méthode

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.
Résultat void