Skip to content

goosetav/format_logs

Repository files navigation

Adds some simple formatting to the standard Rails BufferedLogger class.

This solution aims to be something between the default logging which is missing information such as timestamps, process IDs and severity levels and a full logging solution like log4r

Gem inspired by Paul Dowman’s better_logging

Configurable settings - accepts a hash of options to adjust the output format.

These are the defaults

FormatLogs.settings = {
  :time_format => '%Y-%m-%d %H:%M:%S %z',
  :show_pid => true,
  :show_host => true,
  :show_time => true
}

you can pass any combination of options you want:

FormatLogs.setting = {:show_pid => false}
Rails 3.0+

add:

gem require 'format_logs'

to your Gemfile and then run:

bundle update format_logs

Copyright © 2011 Erik Gustavson

See LICENSE.txt for details.

About

Adds some basic formatting to the default rails logs

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages