PostSharp 6.10 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Backends.​Serilog Namespace / Serilog­Sink­Configuration­Extensions Class / Serilog­Sink­Configuration­Extensions Methods / Serilog­Sink­Configuration­Extensions.​Post­Sharp Method

SerilogSinkConfigurationExtensions.PostSharp Method

Returns the same configuration, except with the Serilog-to-PostSharp sink as an additional sink.

Namespace:  PostSharp.Patterns.Diagnostics.Backends.Serilog
Assembly:  PostSharp.Patterns.Diagnostics.Backends.Serilog (in PostSharp.Patterns.Diagnostics.Backends.Serilog.dll) Version: (
public static LoggerConfiguration PostSharp(
	this LoggerSinkConfiguration sinkConfiguration,
	string defaultLogSourceName = null,
	SerilogParameterHandling parameterHandling = SerilogParameterHandling.Default


Type: LoggerSinkConfiguration
The configuration the sink should be added to.
defaultLogSourceName (Optional)
Type: System.String
Log source name that will be passed to the PostSharp backend for loggers where ForContext(Type) is not used. Optional.
parameterHandling (Optional)
Type: PostSharp.Patterns.Diagnostics.Backends.Serilog.SerilogParameterHandling
Determines how should Serilog parameters in Serilog messages be passed to PostSharp logging.

Return Value

Type: LoggerConfiguration

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type LoggerSinkConfiguration. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also