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

- (Object) format_message(severity, timestamp, progname, msg)

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



13
14
15
# File 'lib/hodel_3000_compliant_logger.rb', line 13

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