functions/core/New-Logger.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function New-Logger {
    <#
    .SYNOPSIS
        Creates new logger
    .DESCRIPTION
        Creates instance of serilog logger configuration
    .INPUTS
        None. You cannot pipe objects to New-Logger
    .OUTPUTS
        Instance of LoggerConfiguration object allowing method chaining
    .EXAMPLE
        PS> New-Logger
    #>


    $loggerConfig = New-Object Serilog.LoggerConfiguration
    $loggerConfig | Add-EnrichWithErrorRecord
}