[ntp:questions] debugging cronic offset on Windows 2003 client

Dave Hart hart at ntp.org
Wed Feb 1 16:39:10 UTC 2012


On Mon, Jan 30, 2012 at 18:21, Lylex Ryan <lylexryan at yahoo.com> wrote:
> What option can I add to the conf file to specify a log file?

logfile "c:\some\dir\ntp.log"

should work, but with the caveat that ntpd logs some information
before processing ntp.conf which will end up in your application event
log.  To log from startup, you need to pass -l (or --logfile) to ntpd
on the command line.

> I don't seem to be able to modify the startup string in the service's
> properties.

I am baffled.  I do this routinely by editing the ImagePath registry
entry under HKLM\system\CurrentControlSet\services\NTP -- usually to
use -l "c:\some\dir\ntp.log"

> I tried adding "logfile <filename>" to the conf file, which didn't seem to work.
> How can I raise the debug level?

Raising the debug level for ntpd running as a service doesn't
accomplish anything useful, as debug output is sent to stdout, which
for a Windows service is connected to the bit bucket.  To run ntpd
with debug tracing on Windows, either grant your user account the
needed privileges (to control the system clock, and optionally to
raise the priority to realtime class), or log on as a member of the
Administrators group, gaining those privileges by default.  Then run
regedit and browse to the ImagePath value mentioned above and copy it
to the clipboard.  From a command prompt, paste the ImagePath command
line and add -D2 (or -D3 for more detail, etc).  Optionally, you might
choose to redirect stdout to a file with "> tracentpd.log" or similar.
 When ntpd is invoked interactively like this, you terminate it with
Ctrl-C.

Separately, you can ensure the normal logging is as verbose as
possible using logconfig:

logconfig =clockall +peerall +syncall +sysall

Newer versions can abbreviate that to "logconfig =allall", but the
above form should work with any version of ntpd.  This controls only
the default syslog/eventlog/--logfile/logfile logging and has no
impact on the debug/trace logging to stdout from -d/-D.

Good luck,
Dave Hart


More information about the questions mailing list