Поделиться через


How to enable verbose logging for Windows Server 2012/2012 R2 Essentials

[This post comes to us courtesy of Swapnil Rane and Rituraj Choudhary from Global Business Support]

This post explains how to increase the logging level for the individual components of Server Essentials role for troubleshooting purposes. In order to accomplish this, we need to modify the Logging.config file. This file can be located at C:\Program Files\Windows Server\Bin on a Windows Server 2012 Essentials machine. On a Windows Server 2012 R2 Essentials this file is present at C:\Windows\System32\Essentials.

Make sure to save a backup copy of the file before modifying it. You need to change the ownership of Logging.config file and give the user adequate permissions to save any modifications to it. You may use the following commands on an elevated Command Prompt to make modifications to the file:

For Windows Server 2012 R2 Essentials:

takeown /f C:\Windows\System32\Essentials\Logging.config
icacls C:\Windows\System32\Essentials\Logging.config /grant administrators:F
icacls C:\Windows\System32\Essentials\Logging.config /setowner "NT Service\TrustedInstaller"
notepad C:\Windows\System32\Essentials\Logging.config

For Windows Server 2012 Essentials:

takeown /f "C:\Program Files\Windows Server\Bin\Logging.config"
icacls "C:\Program Files\Windows Server\Bin\Logging.config" /grant administrators:F
icacls "C:\Program Files\Windows Server\Bin\Logging.config" /setowner "NT Service\TrustedInstaller"
notepad "C:\Program Files\Windows Server\Bin\Logging.config"

The file Logging.config is now ready for editing. Search for the string level= and replace the string next to level= to All if it is set otherwise. For example:

<add level="Warning" name="ProviderFramework">
<listeners>
<add name="DefaultTraceListener" />
</listeners>
</add>

Change it as:

<add level="All" name="ProviderFramework">
<listeners>
<add name="DefaultTraceListener" />
</listeners>
</add>

Changing the level to All enables verbose logging. There are other values that the level can be set to, but mostly verbose logging is preferred, and can be achieved as mentioned above.

When the issue is reproduced subsequently, the logs at C:\ProgramData\Microsoft\Windows Server\Logs folder should now contain verbose information.

Note: You may use the same procedure to enable verbose logging on the Essentials clients.

Comments