# Logging (version 1.0.0)

**URL:** <https://www.ruby-forum.com/t/logging-version-1-0-0/165847>\
**Category:** Ruby\
**Created:** [April 18, 2009, 7:07am UTC](https://www.ruby-forum.com/t/logging-version-1-0-0/165847 "2009-04-18T07:07:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [April 18, 2009, 7:07am UTC](https://www.ruby-forum.com/t/logging-version-1-0-0/165847/1 "2009-04-18T07:07:44Z")

</div>

Logging version 1.0.0  
by Tim P.  
[http://logging.rubyforge.org/](http://logging.rubyforge.org/)

== DESCRIPTION

Logging is a flexible logging library for use in Ruby programs based  
on the  
design of Java’s log4j library. It features a hierarchical logging  
system,  
custom level names, multiple output destinations per log event, custom  
formatting, and more.

== CHANGES

2 major enhancements

- Refactored access to the appenders
- Created a much cleaner way to initialize the logging framework  
3 minor enhancements
- Added a YAML layout option
- Added a JSON layout option
- Cration of an “examples” directory  
1 bug fix
- Logging initialization happens implicitly when a logger, layout, or  
appender is created

== NOTES

There are two new layouts for outputting logs as using parseable  
formats –  
JSON and YAML. This is very nice when you want to sift through very  
large log  
files looking for specific messages or sequences of messages. No more  
messy  
regular expressions. Just use a JSON parser or a YAML parser to ingest  
the log  
messages.

There are quite a few examples of how to use the logging framework in  
the  
“examples” directory. Please take a look at the source package to get  
some  
ideas and inspiration.

The examples also show the favored way for configuring the logging  
framework.  
Please take a look.

This release will introdcue backwards incompatabilities with regard to  
accessing the STDOUT and STDERR appenders. The two lines below show  
the old way  
and the new way:

Logging::Appender.stdout # old way that no longer works  
Logging.appenders.stdout # new way (similar for stderr)

== THANKS

Ara T. Howard gave a great talk about boulder.rb the other night.  
Inspiration  
from that meeting was the germ of this update.

Blessings,  
TwP

---

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [April 18, 2009, 5:53pm UTC](https://www.ruby-forum.com/t/logging-version-1-0-0/165847/2 "2009-04-18T17:53:42Z")

</div>

On Fri, Apr 17, 2009 at 10:07 PM, Tim P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Logging version 1.0.0  
> by Tim P.  
> [http://logging.rubyforge.org/](http://logging.rubyforge.org/)
> 
> == DESCRIPTION
> 
> Logging is a flexible logging library for use in Ruby programs based on the  
> design of Java’s log4j library. It features a hierarchical logging system,  
> custom level names, multiple output destinations per log event, custom  
> formatting, and more.

Hey Tim,  
How does logging compare to log4r?

---

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [April 18, 2009, 7:43pm UTC](https://www.ruby-forum.com/t/logging-version-1-0-0/165847/3 "2009-04-18T19:43:52Z")

</div>

On Sat, Apr 18, 2009 at 9:52 AM, Aaron T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > formatting, and more.
> 
> Hey Tim,  
> How does logging compare to log4r?

Let’s find out

‘logging’ \<=\> ‘log4r’ #=\> 1

Logging supports all the same features of log4r and some improvements  
and nifty new things, too. The rolling log file appender in Logging is  
safe to use from multiple processes; this is not the case with log4r’s  
rolling file outputter.

Logging supports parseable log formats – messages can be output as  
JSON or YAML formatted objects. This makes parsing your log files much  
much easier.

Logging has a growl notification appender for those of you on Mac OS X.

Both support logger hierarchies.

Logging has a cleaner interface (in my opinion).

Check out the examples folder of the logging project to get a feel of  
how to use it and what it is capable of.

> **[GitHub - TwP/logging: A flexible logging library for use in Ruby programs based...](https://github.com/TwP/logging/tree/master)**
>
> master

Blessings,  
TwP
