Configure Puppet agent service on Windows to send logs to file instead of Windows Event Log

By default the Puppet agent on Windows running as a service will send all logs to the Windows Event Log. If want to have these logs to be sent to a file, the service parameters have to be modified.

This can be done by editing the value of ImagePath under HKLM\SYSTEM\CurrentControlSet\Services\puppet in the Windows Registry by appending

--logdest "%ProgramData%\PuppetLabs\puppet\var\log\puppet.log"

Another way to modify service params is to run the following command:

sc config puppet binPath= "\"%ProgramFiles%\Puppet Labs\puppet\sys\ruby\bin\ruby.exe\" -rubygems \"%ProgramFiles%\Puppet Labs\puppet\service\daemon.rb\" --logdest \"%ProgramData%\PuppetLabs\puppet\var\log\puppet.log\""

After that restart the puppet service.

Leave a Reply

Your email address will not be published. Required fields are marked *