您好,登錄后才能下訂單哦!
修改Mcollective支持syslog輸出,同時將默認的utc時間修改為本地時間。
module MCollective module RPC # An audit plugin that just logs to a file # # You can configure which file it logs to with the setting # # plugin.rpcaudit.logfile class Logfile<Audit require 'pp' require 'syslog' def audit_request(request, connection) logfile = Config.instance.pluginconf["rpcaudit.logfile"] || "/var/log/mcollective-audit.log" now = Time.now.strftime("%F %X") File.open(logfile, "a") do |f| f.puts("[#{now}] reqid=#{request.uniqid}: reqtime=#{request.time} caller=#{request.caller}@#{request.sender} agent=#{request.agent} action=#{request.action} data=#{request.dat a.pretty_print_inspect}") end Syslog.open('mcollective',Syslog::LOG_PID,Syslog::LOG_LOCAL4) do |f| f.log(Syslog::LOG_INFO,"[#{now}] reqid=#{request.uniqid}: reqtime=#{request.time} caller=#{request.caller}@#{request.sender} agent=#{request.agent} action=#{request.action} da ta=#{request.data.pretty_print_inspect}") end end end end end
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。