Modify Mcollective's audit support syslog

Source: Internet
Author: User
Tags syslog

Modifying the mcollective supports syslog output while modifying the default UTC time to local time.

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&nBsp;|f|          f.puts ("[#{now}] reqid=#{ request.uniqid}: reqtime=#{request.time} caller=#{request.caller}@#{request.sender} agent=#{ Request.agent} action=#{request.action} data=#{request.data.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}  data=#{request.data.pretty_print_inspect} ")         end       end    end  endend


This article is from the "Xiaofeng Moon" blog, make sure to keep this source http://kinda22.blog.51cto.com/2969503/1587623

Modify Mcollective's audit support syslog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.