Skip to content

SPDiagnosticLoggingSettings

dscbot edited this page Mar 17, 2023 · 18 revisions

SPDiagnosticLoggingSettings

Parameters

Parameter Attribute DataType Description Allowed Values
IsSingleInstance Key String Specifies the resource is a single instance, the value must be 'Yes' Yes
LogPath Required String The physical path on each server to store ULS logs
LogSpaceInGB Required UInt32 The space in GB that should be used to store ULS logs
AppAnalyticsAutomaticUploadEnabled Write Boolean Should app analytics automatically be uploaded
CustomerExperienceImprovementProgramEnabled Write Boolean Should the customer experience program be enabled in this farm
DaysToKeepLogs Write UInt32 How many days should ULS logs be kept for
DownloadErrorReportingUpdatesEnabled Write Boolean Should updates to error reporting tools be automatically downloaded
ErrorReportingAutomaticUploadEnabled Write Boolean Should error reports be automatically uploaded
ErrorReportingEnabled Write Boolean Should reporting of errors be enabled
EventLogFloodProtectionEnabled Write Boolean Protect event logs with Event Log Flood Protection
EventLogFloodProtectionNotifyInterval Write UInt32 What interval should the event logs report a flood event
EventLogFloodProtectionQuietPeriod Write UInt32 What quiet period should reset the event log flood protection thresholds
EventLogFloodProtectionThreshold Write UInt32 What is the event log flood protection threshold
EventLogFloodProtectionTriggerPeriod Write UInt32 What is the time period that will trigger event log flood protection
LogCutInterval Write UInt32 How many minutes of activity will a ULS log file leep in an individual file
LogMaxDiskSpaceUsageEnabled Write Boolean Will the maximum disk space setting be enabled
ScriptErrorReportingDelay Write UInt32 What delay will be set before script error reporting is triggered
ScriptErrorReportingEnabled Write Boolean Is script error reporting enabled in this farm
ScriptErrorReportingRequireAuth Write Boolean Require users to be authenticated to allow script errors to be reported

Description

Type: Distributed Requires CredSSP: No

This resource is responsible for configuring settings to do with the diagnostic (ULS) logging on servers in the farm. These settings are applied to the diagnostic logging service for the farm and do not need to be applied to each server individually, the settings will be propagated throughout the farm when

Examples

Example 1

This example applies the specified diagnostic logging settings to the local SharPoint farm. Any setting not defined will be left as it default, or to whatever value has been manually configured outside of DSC.

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )

    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPDiagnosticLoggingSettings ApplyDiagnosticLogSettings
        {
            IsSingleInstance                            = "Yes"
            LogPath                                     = "L:\ULSLogs"
            LogSpaceInGB                                = 10
            AppAnalyticsAutomaticUploadEnabled          = $false
            CustomerExperienceImprovementProgramEnabled = $true
            DaysToKeepLogs                              = 7
            DownloadErrorReportingUpdatesEnabled        = $false
            ErrorReportingAutomaticUploadEnabled        = $false
            ErrorReportingEnabled                       = $false
            EventLogFloodProtectionEnabled              = $true
            EventLogFloodProtectionNotifyInterval       = 5
            EventLogFloodProtectionQuietPeriod          = 2
            EventLogFloodProtectionThreshold            = 5
            EventLogFloodProtectionTriggerPeriod        = 2
            LogCutInterval                              = 15
            LogMaxDiskSpaceUsageEnabled                 = $true
            ScriptErrorReportingDelay                   = 30
            ScriptErrorReportingEnabled                 = $true
            ScriptErrorReportingRequireAuth             = $true
            PsDscRunAsCredential                        = $SetupAccount
        }
    }
}
Clone this wiki locally