File
yamlconfigurator.rb
Path: log4r/yamlconfigurator.rb
Modified: Wed Mar 17 11:13:07 PST 2004

Configuring Log4r with Log4r::YamlConfigurator

The YamlConfigurator class allows one to set up Log4r via YAML. It is used almost exactly as Log4r::Configurator and has the same features,

  ycfg = YamlConfigurator    # handy shorthand
  ycfg['foo'] = bar          # replaces instances of #{foo} in the YAML with bar
  ycfg.load_yaml_file('foo.yaml')

Ruby 1.7 and 1.8 comes with a YAML parser. Hence, YAML can be used to configure Log4r out of the box.

A comprehensive example of a Log4r YAML configuration is provided in the examples directory.

To use this class:

  require 'log4r/yamlconfigurator'

Thanks to Andreas Hund for making this possible.

Other Info

Version: $Id: yamlconfigurator.rb,v 1.1 2004/03/17 19:13:07 fando Exp $

Required files

log4r/logger log4r/outputter/staticoutputter log4r/logserver log4r/outputter/remoteoutputter yaml
Classes and Modules

Module Log4r
  ::Class Log4r::BasicFormatter
  ::Class Log4r::ConfigError
  ::Class Log4r::Configurator
  ::Class Log4r::DateFileOutputter
  ::Class Log4r::DefaultFormatter
  ::Class Log4r::EmailOutputter
  ::Class Log4r::FileOutputter
  ::Class Log4r::Formatter
  ::Class Log4r::IOOutputter
  ::Class Log4r::Log4rTools
  ::Class Log4r::LogEvent
  ::Class Log4r::LogServer
  ::Class Log4r::Logger
  ::Class Log4r::ObjectFormatter
  ::Class Log4r::Outputter
  ::Class Log4r::PatternFormatter
  ::Class Log4r::RemoteOutputter
  ::Class Log4r::RollingFileOutputter
  ::Class Log4r::RootLogger
  ::Class Log4r::SimpleFormatter
  ::Class Log4r::StderrOutputter
  ::Class Log4r::StdoutOutputter
  ::Class Log4r::SyslogOutputter
  ::Class Log4r::YamlConfigurator