# Configure diagnostic logging SharePoint 2016

- Link: https://sharepointtechnicalsupport.com/2017/01/15/configure-diagnostic-logging-sharepoint-2016/
- Published: 2017-01-15T18:20:34+05:30
- Author: Deviprasad Panda

[siteorigin_widget class=”WordAds_Sidebar_Widget”][/siteorigin_widget]

[siteorigin_widget class=”WordAds_Sidebar_Widget”][/siteorigin_widget]

 The SharePoint Server 2016 environment might require configuration of the diagnostic
logging settings after initial deployment, after upgrade, and if a change is made
to the environment, such as adding or removing a server. Below description all about
Configure diagnostic logging SharePoint 2016

The guidelines in the following list can help you form best practices for the specific
environment.

**\* Change the drive to which the server writes logs:**

By default, SharePoint Server 2016 writes diagnostic logs to the same drive and 
partition on which it was installed. Because diagnostic logging can use a large 
amount of drive space and compromise drive performance, you should configure SharePoint
Server 2016 to write to another drive on which SharePoint Server 2016 is not installed.

You should also consider the connection speed to the drive on which SharePoint Server
2016 writes the logs. If verbose-level logging is configured, the server records
a large amount of data. Therefore, a slow connection might result in poor log performance.

**\* Restrict log disk space usage:**

By default, the amount of disk space that diagnostic logging can use is unlimited.
Therefore, restrict the disk space that logging uses, especially if you configure
logging to write verbose-level events. When the disk reaches the restriction, SharePoint
Server 2016 removes the oldest logs before it records new logging data.

**\* Use the Verbose setting sparingly:**

You can configure diagnostic logging to record verbose-level events. This means 
that SharePoint Server 2016 records every action that it takes. Verbose-level logging
can quickly use drive space and affect drive and server performance. You can use
verbose-level logging to record more detail when you are making critical changes
and then reconfigure logging to record only higher-level events after you make the
change.

**\* Regularly back up logs:**

Diagnostic logs contain important data. Therefore, back up the logs regularly to
ensure that this data is preserved. When you restrict log drive space usage, or 
if you keep logs for only a few days, SharePoint Server 2016 automatically deletes
log files, starting with the oldest files first, when the threshold is met.

**\* Enable event log flooding protection:**

When you enable this setting, SharePoint Server 2016 detects repeating events in
the Windows event log, and suppresses them until conditions return to a typical 
state.

You can set the level of diagnostic logging for the event log and for the trace 
log. This limits the types and amount of information that are written to each log.

The following tables define the levels of logging that are available for the event
log and trace log.

![event-log-levels](https://i0.wp.com/sharepointtechnicalsupport.com/wp-content/
uploads/2017/01/event-log-levels.png?resize=584%2C240&ssl=1)

![trace-log-levels](https://i0.wp.com/sharepointtechnicalsupport.com/wp-content/
uploads/2017/01/trace-log-levels.png?resize=584%2C363&ssl=1)

Configure diagnostic logging by using Central Administration :

 1.  In Central Administration, on the home page, click **Monitoring**.
 2.  On the Monitoring page, in the **Reporting** section, click **Configure diagnostic
     logging**.
 3.  On the Diagnostic Logging page, in the **Event Throttling** section, configure
     event throttling as follows:To configure event throttling for all categories:
 4.   a. Select the **All Categories** check box.
      b. Select the event log level from the **Least critical event to report to the event
         log** list.
      c. Select the trace log level from the **Least critical event to report to the trace
         log** list.
 5.  To configure event throttling for one or more categories:
 6.   a. Select the check boxes of the categories that you want.
      b. Select the event log level from the **Least critical event to report to the event
         log** list.
      c. Select the trace log level from the **Least critical event to report to the trace
         log** list.
 7.  To configure event throttling for one or more subcategories (you can expand one
     or more categories and select any subcategory):
 8.   a. Click the plus **(+)** next to the category to expand the category.
      b. Select the check box of the subcategory.
      c. Select the event log level from the **Least critical event to report to the event
         log** list.
      d. Select the trace log level from the **Least critical event to report to the trace
         log** list.
 9.  To return event throttling for all categories to default settings:
 10.  a. Select the **All Categories** check box.
      b. Select **Reset to default** from the **Least critical event to report to the 
         event log** list.
      c. Select **Reset to default** from the **Least critical event to report to the 
         trace log** list.
 11. In the **Event Log Flood Protection** section, select the **Enable Event Log Flood
     Protection** check box.
 12. In the **Trace Log** section, in the **Path** box, type the path of the folder
     to which you want logs to be written.
 13. In the **Number of days to store log files** box, type the number of days (1-366)
     that you want logs to be kept. After this time, logs will automatically be deleted.
 14. To restrict the disk space that logs can use, select the **Restrict Trace Log 
     disk space usage** check box, and then type the number gigabytes (GB) you want
     to restrict log files to. When logs reach this value, older logs will automatically
     be deleted.
 15. After you have made the changes that you want on the Diagnostic Logging page, 
     click **OK**.

Configure diagnostic logging by using Windows PowerShell :

 1. Verify that you have the following memberships:

 * **securityadmin** fixed server role on the SQL Server instance.
 * **db_owner** fixed database role on all databases that are to be updated.
 * Administrators group on the server on which you are running the Windows PowerShell
   cmdlets.

An administrator can use the **Add-SPShellAdmin** cmdlet to grant permissions to
use SharePoint Server 2016 cmdlets.

2. On the **Start** menu, click **All Programs**.
3. Click **SharePoint 2016**.4.
Click **SharePoint 2016 Management Shell**.5. To change the drive to which the server
writes logs, at the Windows PowerShell command prompt, type the following command:

**Set-SPDiagnosticConfig -LogLocation D:\DiagnosticLogs**

6. To restrict log disk space usage, at the Windows PowerShell command prompt, type
the following command:

**Set-SPDiagnosticConfig -LogMaxDiskSpaceUsageEnabled**

Or assign the maximum disk space for logs:

**Set-SPDiagnosticConfig -LogDiskSpaceUsageGB 500**

7. To view the current logging level, at the Windows PowerShell command prompt, 
type the following command:

**Get-SPLogLevel**

8. To change the logging level, at the Windows PowerShell command prompt, type the
following command:

**Set-SPLogLevel -TraceSeverity Monitorable**

To set all categories back to default levels, at the Windows PowerShell command 
prompt, type the following command, and then press ENTER:

**Clear-SPLogLevel**

9. To enable event log flooding protection, at the Windows PowerShell command prompt,
type the following command:

**Set-SPDiagnosticConfig -EventLogFloodProtectionEnabled**

### Share this:

 * [  X ](https://sharepointtechnicalsupport.com/2017/01/15/configure-diagnostic-logging-sharepoint-2016/?share=twitter)
 * [  Facebook ](https://sharepointtechnicalsupport.com/2017/01/15/configure-diagnostic-logging-sharepoint-2016/?share=facebook)
 * [  WhatsApp ](https://sharepointtechnicalsupport.com/2017/01/15/configure-diagnostic-logging-sharepoint-2016/?share=jetpack-whatsapp)
 * [  Email ](https://sharepointtechnicalsupport.com/2017/01/15/configure-diagnostic-logging-sharepoint-2016/?subject=%5BShared%20Post%5D%20Configure%20diagnostic%20logging%20SharePoint%202016&body=https%3A%2F%2Fsharepointtechnicalsupport.com%2F2017%2F01%2F15%2Fconfigure-diagnostic-logging-sharepoint-2016%2F&share=email)
 * [  Telegram ](https://sharepointtechnicalsupport.com/2017/01/15/configure-diagnostic-logging-sharepoint-2016/?share=telegram)
 * [  LinkedIn ](https://sharepointtechnicalsupport.com/2017/01/15/configure-diagnostic-logging-sharepoint-2016/?share=linkedin)
 * [  Tumblr ](https://sharepointtechnicalsupport.com/2017/01/15/configure-diagnostic-logging-sharepoint-2016/?share=tumblr)
 * [  Pinterest ](https://sharepointtechnicalsupport.com/2017/01/15/configure-diagnostic-logging-sharepoint-2016/?share=pinterest)

### Like this:

Like Loading…

### _Related_
