PowerShellSinkExtensions.PowerShell method

Adds a PowerShell sink to the Serilog logger configuration.

public static LoggerConfiguration PowerShell(this LoggerSinkConfiguration loggerConfiguration, 
    Action<LogEvent, string> callback, 
    LogEventLevel restrictedToMinimumLevel = LogEventLevel.Verbose, 
    string outputTemplate = "{Message:lj}", LoggingLevelSwitch? levelSwitch = null)
parameter description
loggerConfiguration The logger sink configuration.
callback Callback to handle log events and formatted output.
restrictedToMinimumLevel The minimum level for events passed through the sink.
outputTemplate The output template for formatting log messages.
levelSwitch Optional level switch for controlling logging level.

Return Value

The logger configuration with the PowerShell sink added.

See Also