简体   繁体   中英

How to modify the default `--logdest eventlog` for the Puppet Agent service on Windows?

I'm running Puppet Agent as a service on Windows but I'm unable to find in the docs how to modify the default behaviour --logdest eventlog to --logdest <FILE> . I want to have agent logs stored in a file, and not in the Windows Event Log, or better - if that's possible - have them sent back to the Puppet Master.

You can add the --logdest to the 'ImagePath' value located in this registry key:

HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\\pe-puppet

We add the switch through puppet code after the agent is installed, meaning that the first run output goes to the event log, but all the subsequent are sent to the local file. You can also modify the reg key during install through a powershell script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM