class MCollective::RPC::Logfile - mcollective version 2.12.5

# class MCollective::RPC::Logfile

An audit plugin that just logs to a file

You can configure which file it logs to with the setting

    plugin.rpcaudit.logfile

### Public Instance Methods

audit_request(request, connection) click to toggle source

       # File lib/mcollective/audit/logfile.rb
    12 def audit_request(request, connection)
    13   logfile = Config.instance.pluginconf["rpcaudit.logfile"] || "/var/log/puppetlabs/mcollective/mcollective-audit.log"
    14
    15   now = Time.now
    16   # Already told timezone to be in UTC so we don't look it up again
    17   # This avoids platform specific timezone representation issues
    18   now_iso8601 = now.utc.strftime("%Y-%m-%d %H:%M:%S UTC")
    19
    20   File.open(logfile, "a") do |f|
    21     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}")
    22   end
    23 end