Open sandboxFocus

Class SerilogLoggingBackendOptions

Options for SerilogLoggingBackend.

Inheritance
SerilogLoggingBackendOptions
Namespace: PostSharp.Patterns.Diagnostics.Backends.Serilog
Assembly: PostSharp.Patterns.Diagnostics.Backends.Serilog.dll
Syntax
public class SerilogLoggingBackendOptions : TextLoggingBackendOptions
Remarks

By default, parameter values are formatted by PostSharp Logging and passed to Serilog as strings. Set UseSerilogFormatters to pass the unformatted values instead. To pass more pieces of information as Serilog properties, set SemanticParametersTreatedSemantically and IncludedSpecialProperties; semantic properties have a significant performance cost in Serilog.

Constructors

Name Description
SerilogLoggingBackendOptions()

Initializes a new instance of the SerilogLoggingBackendOptions class.

Fields

Name Description
SemanticParametersRequiredTreatedSemantically

The kinds of semantic parameters that are required to be mapped to Serilog parameters. This is the default value of the SemanticParametersTreatedSemantically property. The value of this constant is ParameterValue | Exception | ReturnValue | ReturnItemValue | ExecutionTime | This.

Properties

Name Description
GetLogger

Gets or sets the function that maps a SerilogLoggingTypeSource to a Serilog ILogger. The default behavior is to call typeSource.Backend.Logger.ForContext( typeSource.SourceType ).

IncludedSpecialProperties

Gets or sets the special properties that should be added to the list of event properties.

LogEventEnricher

Gets or sets a delegate to a method that can add properties to or remove properties from the Serilog.Events.LogEvent immediately before it is written to Serilog.

SemanticParametersTreatedSemantically

Gets or sets the kinds of semantic parameters that must be mapped to Serilog semantic parameters.

UseSerilogFormatters

Gets or sets a value indicating whether Serilog formatters should be used instead of PostSharp formatters. The default value is false.

See Also