Class | MCollective::RPC::Logfile |
In: |
plugins/mcollective/audit/logfile.rb
|
Parent: | Audit |
An audit plugin that just logs to a file
You can configure which file it logs to with the setting
plugin.rpcaudit.logfile
# File plugins/mcollective/audit/logfile.rb, line 12 12: def audit_request(request, connection) 13: logfile = Config.instance.pluginconf["rpcaudit.logfile"] || "/var/log/mcollective-audit.log" 14: 15: now = Time.now 16: now_tz = tz = now.utc? ? "Z" : now.strftime("%z") 17: now_iso8601 = "%s.%06d%s" % [now.strftime("%Y-%m-%dT%H:%M:%S"), now.tv_usec, now_tz] 18: 19: File.open(logfile, "a") do |f| 20: f.puts("#{now_iso8601}: reqid=#{request.uniqid}: reqtime=#{request.time} caller=#{request.caller}@#{request.sender} agent=#{request.agent} action=#{request.action} data=#{request.data.pretty_print_inspect}") 21: end 22: end