Log file for Windows Time service

Sometimes for troubleshooting issues, is it required to have a log file which logs info about the time synchronisation.
By these a small howto.

 

Enabling logging

  • Create a reg file (w32Time_Log.reg) with the following contents:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Config]
    "FileLogSize"=dword:10000000
    "FileLogName"="C:\\Windows\\Temp\\w32time.log"
    "FileLogEntries"="0-116"
  • Import the file with the following command (Or just double click on it)

    regedit /s w32Time_Log.reg
  • Restart the Windows Time server

    service stop "Windows Time"
    service start "Windows Time"

From now on, will the service log his info into the file specified.

Disabling logging

Of course, once the issues are solved you can stop the logging. This can be performed as follow:

  • Create a reg file (w32Time_Log_Remove.reg) with the following content:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Config]
    "FileLogSize"=-
    "FileLogName"=-
    "FileLogEntries"=-
  • Import the file with the following command:

    regedit /s w32Time_Log_Remove.reg
  • Restart the Windows Time server

    service stop "Windows Time"
    service start "Windows Time"

Now is the logging disable

Info on above logging stuff How to turn debug logging in the Windows Time Service

Info on registry How to add, modify, or delete registry subkeys and values by using registration entries

Additional information