Sha256: 11ecf6fe06bfec03c9c4ba8142c9239d3803f907d1d53a670ac9d3e687f28cb7
Contents?: true
Size: 695 Bytes
Versions: 17
Compression:
Stored size: 695 Bytes
Contents
module LogjamAgent class SyslogLikeFormatter def initialize @hostname = LogjamAgent.hostname @app_name = "rails" end def format_time(timestamp) timestamp.strftime("%b %d %H:%M:%S.#{"%06d" % timestamp.usec}") end def format_message(msg) msg.strip end def call(severity, timestamp, progname, msg) "#{severity} #{format_time(timestamp)}#{format_host_info(progname)}: #{format_message(msg)}\n" end if !defined?(Rails::Railtie) || Rails.env.development? def format_host_info(progname); ""; end else def format_host_info(progname) " #{@hostname} #{progname||@app_name}[#{$$}]" end end end end
Version data entries
17 entries across 17 versions & 1 rubygems