C# Класс Serilog.Events.LogEvent

A log event.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

AddOrUpdateProperty() публичный метод

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.
Результат void

AddPropertyIfAbsent() публичный метод

Add a property to the event if not already present.
public AddPropertyIfAbsent ( LogEventProperty property ) : void
property LogEventProperty The property to add.
Результат void

LogEvent() публичный метод

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 .
Результат System

RemovePropertyIfPresent() публичный метод

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.
Результат void

RenderMessage() публичный метод

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.
Результат string

RenderMessage() публичный метод

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.
Результат void