Skip to content

Latest commit

 

History

History
149 lines (111 loc) · 3.13 KB

Set-PnPTraceLog.md

File metadata and controls

149 lines (111 loc) · 3.13 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Set-PnPTraceLog

SYNOPSIS

Turn log tracing on or off

SYNTAX

On

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

Off

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------------------

PS:> 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------------------

PS:> 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------------------

PS:> 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------------------

PS:> 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
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-Delimiter

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

Type: String
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-IndentSize

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

Type: Int
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-Level

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

Type: LogLevel
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-LogFile

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

Type: String
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-Off

Turn off tracing to log file.

Type: SwitchParameter
Parameter Sets: Off

Required: True
Position: Named
Accept pipeline input: False

-On

Turn on tracing to log file

Type: SwitchParameter
Parameter Sets: On

Required: True
Position: Named
Accept pipeline input: False

RELATED LINKS

SharePoint Developer Patterns and Practices