下面是我的 puppet master puppet.conf 文件
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
certname = puppet
dns_alt_names = puppet
[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
雖然我在設定中指定了 logdir /var/log/puppet
,但 puppet master 日誌是在/var/log/syslog
有什麼解決辦法嗎?
答案1
您可以透過編輯來自訂主日誌目標:
/etc/default/puppet
(Ubuntu 12.04 LTS)- 編輯:
/etc/init.d/puppet
(Ubuntu 14.04 LTS)
將以下內容新增至DAEMON_OPTS
:
DAEMON_OPTS="--logdest=/var/log/puppet/master.log"
答案2
在系統日誌守護程序中設定日誌記錄應該很簡單。我使用的配置如下。確保在進行更改後重新啟動 ryslog。
/etc/rsyslog.d/40-puppet.conf
# PUPPETHEADER: This file is owned by Puppet.
if $programname == 'puppet-agent' then -/var/log/puppet/puppet.log
& ~
if $programname == 'puppet-master' then -/var/log/puppet/puppetmaster.log
& ~