Class

Logger

Extends:

Adds the ‘around_level’ method to Logger.

From active_support/clean_logger.rb

Extensions to the built in Ruby logger.

If you want to use the default log formatter as defined in the Ruby core, then you will need to set the formatter for the logger as in:

logger.formatter = Formatter.new

You can then specify the datetime format, for example:

logger.datetime_format = "%Y-%m-%d"

Note: This logger is deprecated in favor of ActiveSupport::BufferedLogger

Classes
Formatter
SimpleFormatter Simple formatter which only displays the message.
Aliases
old_datetime_format
old_datetime_format=
old_format_datetime
old_format_message
old_formatter
old_msg2str
Public Methods
datetime_format Get the logging datetime format. Returns nil if the formatter does not support datetime formatting.
datetime_format= Logging date-time format (string passed to strftime). Ignored if the formatter does not respond to datetime_format=.
define_around_helper
formatter Get the current formatter. The default formatter is a SimpleFormatter which only displays the log message
silence Silences the logger for the duration of the block.
Private Methods
format_datetime
format_message
format_message
msg2str
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.