Set LogConfiguration - PPOSHGROUP/PPoShTools GitHub Wiki

Set-LogConfiguration

PPoShTools -> Set-LogConfiguration.ps1

Synopsis

Sets global logging configuation (used by Write-Log).

Syntax

Set-LogConfiguration [[-LogLevel] <String>] [[-LogFile] <String>] 
[-LogEventLogSource] [-LogEventLogThreshold] [<CommonParameters>]

Description

It sets $LogConfiguration object which describes logging configuration (see LogConfiguration.ps1).

Parameters

-LogLevel<String>

Logging level threshold. Only messages with this level or above will be logged (default: Info).

  • Valid values: <empty>, Debug, Info, Warn, Error
  • PipelineInput: false
  • Required: false

-LogFile<String>

Path to additional file log or $null if shouldn't log to file (default: $null).

  • PipelineInput: false
  • Required: false

-LogEventLogSource<SwitchParameter> (default: False)

Name of Event Log Source to log to or $null if shouldn't log to Event Log (default: $null).

  • DefaultValue: False
  • PipelineInput: false
  • Required: false

-LogEventLogThreshold<SwitchParameter> (default: False)

Logging level threshold for Event Log. This would normally have higher threshold than LogLevel (default: Error).

  • Valid values: <empty>, Debug, Info, Warn, Error
  • DefaultValue: False
  • PipelineInput: false
  • Required: false

Examples

Example 1

Set-LogConfiguration -LogLevel 'Warn' -LogFile "$PSScriptRoot\test.log"
⚠️ **GitHub.com Fallback** ⚠️