Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/topfunky/hodel_3000_compliant_logger
Alternate logger for Rails that emits syslog-style output. For use with pl_analyze gem.
https://github.com/topfunky/hodel_3000_compliant_logger
Last synced: 4 days ago
JSON representation
Alternate logger for Rails that emits syslog-style output. For use with pl_analyze gem.
- Host: GitHub
- URL: https://github.com/topfunky/hodel_3000_compliant_logger
- Owner: topfunky
- License: mit
- Created: 2008-12-22T19:31:13.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T22:08:45.000Z (almost 2 years ago)
- Last Synced: 2024-10-14T06:38:13.736Z (about 1 month ago)
- Language: Ruby
- Homepage: http://nubyonrails.com/articles/a-hodel-3000-compliant-logger-for-the-rest-of-us
- Size: 15.6 KB
- Stars: 42
- Watchers: 4
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.rdoc
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
== Hodel 3000 Compliant Logger
The Hodel 3000 Compliant Logger outputs like SyslogLogger (http://seattlerb.rubyforge.org/SyslogLogger/), except it doesn't need a syslog daemon running, such that your log come out exactly like syslog logs.
Mostly, this is intended to let you use tools that assume your log are in this syslog format, including:
* Rails Analyzer Tools: http://rails-analyzer.rubyforge.org/
* oink: http://github.com/noahd1/oinkSee initial announcement here: http://nubyonrails.com/articles/a-hodel-3000-compliant-logger-for-the-rest-of-us
=== Installation and configuration
gem install hodel_3000_compliant_logger
The main thing hodel_3000_complaint_logger provides is the Hodel3000CompliantLogger class. It's a subclass of Logger (http://ruby-doc.org/core/classes/Logger.html), so you can use it as you would any Logger, really, except it outputs slightly different.
require 'hodel_3000_compliant_logger'
log = Hodel3000CompliantLogger.new(STDOUT)
log.level = Logger::WARNlog.debug("Created logger")
log.info("Program started")
log.warn("Nothing to do!")To use hodel_3000_complaint_logger in Rails 4 as a replacement for the default logger, place the following line in your config/application.rb:
config.logger = Hodel3000CompliantLogger.new(config.paths['log'].first)
In Rails 3, use the following line instead (in config/application.rb):
config.logger = Hodel3000CompliantLogger.new(config.paths.log.first)
In Rails 2, instead use the following in your config/environment.rb file:
config.logger = Hodel3000CompliantLogger.new(config.paths.log.first)
=== NOTE
If you are using FastCGI, you may need to hard-code the hostname instead of using Socket.gethostname
== Author
Geoffrey Grosenbach, with help from Eric Hodel
http://topfunky.com
== Changes
* Nov 29, 2007: Improvements and spec from Chris Bernard [http://logicleaf.com/]