Set-PnPTraceLog

Turn log tracing on or off

Syntax

Set-PnPTraceLog
   -On [<SwitchParameter>]
                  [-LogFile <String>]
                  [-Level <LogLevel>]
                  [-Delimiter <String>]
                  [-IndentSize <Int>]
                  [-AutoFlush <Boolean>]
Set-PnPTraceLog
   -Off [<SwitchParameter>]

Description

Defines if tracing should be turned on. PnP Core, which is the foundation of these cmdlets, uses the standard Trace functionality of .NET. With this cmdlet you can turn capturing of this trace to a log file on or off. Notice that basically only the Provisioning Engine writes to the tracelog which means that cmdlets related to the engine will produce output.

Examples

------------------EXAMPLE 1------------------

Set-PnPTraceLog -On -LogFile traceoutput.txt

This turns on trace logging to the file 'traceoutput.txt' and will capture events of at least 'Information' level.

------------------EXAMPLE 2------------------

Set-PnPTraceLog -On -LogFile traceoutput.txt -Level Debug

This turns on trace logging to the file 'traceoutput.txt' and will capture debug events.

------------------EXAMPLE 3------------------

Set-PnPTraceLog -On -LogFile traceoutput.txt -Level Debug -Delimiter ","

This turns on trace logging to the file 'traceoutput.txt' and will write the entries as comma separated. Debug events are captured.

------------------EXAMPLE 4------------------

Set-PnPTraceLog -Off

This turns off trace logging. It will flush any remaining messages to the log file.

Parameters

-AutoFlush

Auto flush the trace log. Defaults to true.

Type:Boolean
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Delimiter

If specified the trace log entries will be delimited with this value.

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-IndentSize

Indents in the tracelog will be with this amount of characters. Defaults to 4.

Type:Int
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Level

The level of events to capture. Possible values are 'Debug', 'Error', 'Warning', 'Information'. Defaults to 'Information'.

Type:LogLevel
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-LogFile

The path and filename of the file to write the trace log to.

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Off

Turn off tracing to log file.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-On

Turn on tracing to log file

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False