Git Product home page Git Product logo

hodel_3000_compliant_logger's Introduction

Hodel 3000 Compliant Logger

The Hodel 3000 Compliant Logger outputs like SyslogLogger (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:

See initial announcement here: nubyonrails.com/articles/a-hodel-3000-compliant-logger-for-the-rest-of-us

Installation and congiguration

gem install hodel_3000_compliant_logger

The main thing hodel_3000_complaint_logger provides is the Hodel3000CompliantLogger class. It’s a subclass of Logger (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::WARN

log.debug("Created logger")
log.info("Program started")
log.warn("Nothing to do!")

To use hodel_3000_complaint_logger in Rails 3 as a replacement for the default logger, place the following line in your application.rb:

config.logger = Hodel3000CompliantLogger.new(config.paths.log.first)

In Rails 2, instead use the following in your 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

topfunky.com

Changes

  • Nov 29, 2007: Improvements and spec from Chris Bernard [logicleaf.com/]

hodel_3000_compliant_logger's People

Contributors

topfunky avatar tdantas avatar tylerhunt avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.