Class: Hodel3000CompliantLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/hodel_3000_compliant_logger.rb

Overview

A logger for use with pl_analyze and other tools that expect syslog-style log output.

Instance Method Summary collapse

Instance Method Details

#format_message(severity, timestamp, progname, msg) ⇒ Object

Note: If you are using FastCGI you may need to hard-code the hostname here instead of using Socket.gethostname



10
11
12
# File 'lib/hodel_3000_compliant_logger.rb', line 10

def format_message(severity, timestamp, progname, msg)
  "#{timestamp.strftime("%b %d %H:%M:%S")} #{hostname} rails[#{$PID}]: #{msg2str(msg).gsub(/\n/, '').lstrip}\n"
end