en-US/about_SPLogLevel.help.txt

.NAME
    SPLogLevel
 
# Description
     
    **Type:** Distributed
    **Requires CredSSP:** No
     
    This resource is used to change the minimum severity of events captured in
    the trace logs (ULS logs) and the Windows event logs. Settings can be changed
    globally for all areas and categories (using the '*' character as the
    wildcard), for all categories within an area, and for specific categories
    within an area. Settings can be changed to desired valid values, or set to the
    default by using the keyword 'Default' as the trace level and event level.
    You must specify a unique name for each instance of this resource in a configuration.
     
.PARAMETER Name
    Key - String
    Friendly Name used to reference this collection of log level settings
 
.PARAMETER SPLogLevelSetting
    Required - String
    Collection of SPLogLevelItems to set
 
.PARAMETER InstallAccount
    Write - String
    POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5
 
 
.EXAMPLE
    This example sets an Area / Category item to a custom value.
 
Configuration Example
{
    param(
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )
    Import-DscResource -ModuleName SharePointDsc
 
    node localhost {
        SPLogLevel SetUserProfileLogingtoVerbose
        {
            Name = "SP_Database-Verbose"
            SPLogLevelSetting = @(
                MSFT_SPLogLevelItem {
                    Area = "SharePoint Server"
                    Name = "Database"
                    TraceLevel = "Verbose"
                    EventLevel = "Verbose"
                }
            )
            PsDscRunAsCredential = $SetupAccount
        }
    }
}
 
 
.EXAMPLE
    This example sets an entire Area to the default values
 
Configuration Example
{
    param(
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )
    Import-DscResource -ModuleName SharePointDsc
 
    node localhost {
        SPLogLevel SetAllSPServerToDefault
        {
            Name = "SPServer_defaults"
            SPLogLevelSetting = @(
                MSFT_SPLogLevelItem {
                    Area = "SharePoint Server"
                    Name = "*"
                    TraceLevel = "Default"
                    EventLevel = "Default"
                }
            )
            PsDscRunAsCredential = $SetupAccount
        }
    }
}
 
 
.EXAMPLE
    This example sets multiple items to custom values
 
Configuration Example
{
    param(
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )
    Import-DscResource -ModuleName SharePointDsc
 
    node localhost {
        SPLogLevel SetCustomValues
        {
            Name = "CustomLoggingSettings"
            SPLogLevelSetting = @(
                MSFT_SPLogLevelItem {
                    Area = "SharePoint Server"
                    Name = "Database"
                    TraceLevel = "Verbose"
                    EventLevel = "Verbose"
                }
                MSFT_SPLogLevelItem {
                    Area = "Business Connectivity Services"
                    Name = "Business Data"
                    TraceLevel = "Unexpected"
                    EventLevel = "Error"
                }
            )
            PsDscRunAsCredential = $SetupAccount
        }
    }
}