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
Check what are the diagnostic provider
we can use the powershell cmdlet “Get-SPDiagnosticsProvider” to check what are the diagnostic provider.

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

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

ULS log settings or sharepoint 2016 logs location
We can run the command “Get-SPDiagnosticConfig” to get ULS logging settings
Get-SPDiagnosticConfig

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


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"

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"

Create new log file
we can create a new log file by running the command below.
New-SPLogFile

Categories: Log, powershell
You must be logged in to post a comment.