-
Notifications
You must be signed in to change notification settings - Fork 107
SPLogLevel
dscbot edited this page Mar 17, 2023
·
10 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Name | Key | String | Friendly Name used to reference this collection of log level settings | |
SPLogLevelSetting | Required | MSFT_SPLogLevelItem[] | Collection of SPLogLevelItems to set |
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Area | Key | String | Log Item Area | |
Name | Key | String | Log Item Name | |
TraceLevel | Write | String | Minimum severity to capture in the trace logs |
None , Unexpected , Monitorable , High , Medium , Verbose , VerboseEx , Default
|
EventLevel | Write | String | Minimum severity to capture in the event logs |
None , ErrorCritical , Error , Warning , Information , Verbose , Default
|
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.
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
}
}
}
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
}
}
}
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
}
}
}
- Home
- Getting Started
- Pre-requisites
- Installing the module
- Exporting SharePoint Configuration
- Creating Configuration Files
- Pre-created Examples
- Creating an Azure development environment
- Understanding Resources & Syntax
- Remote PowerShell Authentication
- Contributing to SharePointDsc
- Other useful modules for SharePoint DSC configurations