Class DaemonKit::AbstractLogger
In: lib/daemon_kit/abstract_logger.rb
Parent: Object

One of the key parts of succesful background processes is adequate logging. The AbstractLogger aims to simplify logging from inside daemon processes by providing additional useful information with each log line, including calling file name and line number and support for cleanly logging exceptions.

The logger can be accessed through DaemonKit.logger.

AbstractLogger provides an interface that is fully compatible with the Logger class provided by Ruby‘s Standard Library, and is extended with some additional conveniences.

The AbstractLogger supports different backends, by default it uses a Logger instance, but can by swapped out for a SysLogLogger logger as well.

Methods

add   clean_trace   close   debug   debug?   error   error?   exception   fatal   fatal?   info   info?   level   level=   logger   logger=   new   silence   unknown   unknown?   warn   warn?  

Classes and Modules

Class DaemonKit::AbstractLogger::Formatter

Attributes

copy_to_stdout  [RW] 
severities  [R] 
silencer  [RW] 

Public Class methods

Optional log path, defaults to DAEMON_ROOT/log/DAEMON_ENV.log

Public Instance methods

Silence the logger for the duration of the block.

[Validate]