Tag Archives: Set-SPDiagnosticConfig

logging-1920x1080

log management open source

log management open source

In this article we will discuss about log management open source. How to manage log using powershell. Below are points we will check using powershell.

  • Check what are the diagnostic provider
  • How to disable or enable event log provider
  • ULS log settings or sharepoint 2016 logs location
  • Change ULS log settings or sharepoint 2016 logs location
  • How to find ULS logging level
  • Set ULS log verbose
Advertisements
Advertisements

Check what are the diagnostic provider

we can use the powershell cmdlet “Get-SPDiagnosticsProvider” to check what are the diagnostic provider.

log-management_1589x611

How to disable or enable event log provider

We can run the below to command to disable event log provider that is “job-diagnostics-event-log-provider” provider.

Get-SPDiagnosticsProvider job-diagnostics-event-log-provider | Set-SPDiagnosticsProvider -Enable:$false
Get-SPDiagnosticsProvider job-diagnostics-event-log-provider
job-diagnostics-event-log-provider-1581x277

We can run the below to command to enable event log provider that is “job-diagnostics-event-log-provider” provider

Get-SPDiagnosticsProvider job-diagnostics-event-log-provider | Set-SPDiagnosticsProvider -Enable:$true
Get-SPDiagnosticsProvider job-diagnostics-event-log-provider
enable-job-diagnostics-event-log-provider-1577x268
Advertisements
Advertisements

ULS log settings or sharepoint 2016 logs location

We can run the command “Get-SPDiagnosticConfig” to get ULS  logging settings

Get-SPDiagnosticConfig
Get-SPDiagnosticConfig-1315x687

Change ULS log settings or sharepoint 2016 logs location

we can run the command “Set-SPDiagnosticConfig” to Change ULS log settings or sharepoint 2016 logs location.

PS C:\> Set-SPDiagnosticConfig -DaysToKeepLogs 7 -LogLocation "E:\Logs" -EventLogFloodProtectionEnabled
PS C:\> Get-SPDiagnosticConfig
change-sharepoint-2016-logs-location-1317x712
diagnostic-logging-1255x665
Advertisements
Advertisements

How to find ULS logging level

We can run the command “Get-SPLogLevel” to find ULS logging level.

Get-SPLogLevel -identity "eApproval:*", General, audit, "Business Data"
Get-SPLogLevel-1314x534

Set ULS log verbose

we can set ULS log Verbose and categories by using “Set-SPLogLevel

Set-SPLogLevel -TraceSeverity verbose -EventSeverity verbose -Identity "eApproval:*", General, audit, "Business Data"
Get-SPLogLevel -identity "eApproval:*", General, audit, "Business Data"
Set-SPLogLevel-1317x625

Create new log file

we can create a new log file by running the command below.

New-SPLogFile
new-splogfile-1316x108
Advertisements
Advertisements
Advertisements