# Logging 0.7.0 (Quixotic Starfish)

**URL:** <https://www.ruby-forum.com/t/logging-0-7-0-quixotic-starfish/128968>\
**Category:** Ruby\
**Created:** [February 13, 2008, 2:22am UTC](https://www.ruby-forum.com/t/logging-0-7-0-quixotic-starfish/128968 "2008-02-13T02:22:54Z")\
**Posts on this page:** 5\
**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:** [February 13, 2008, 2:22am UTC](https://www.ruby-forum.com/t/logging-0-7-0-quixotic-starfish/128968/1 "2008-02-13T02:22:54Z")

</div>

== Logging  
by Tim P.  
[http://logging.rubyforge.org](http://logging.rubyforge.org)  
(the “Quixotic Starfish” release)

== 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.

This release addresses compatibility issues with Rails, seed  
improvements,  
and one or two minor tweaks and bug fixes. See the changes section  
for all  
the gory details. However, this release is not quite backwards  
compatible  
with the 0.6.\* and earlier versions. The reason is the  
Logging::Logger#add  
method. It was reworked to semantically conform to the Ruby Standard  
Library’s Logger#add method – this provides the Rails compatibility.

For users of earlier versions of logging, you will need to change any  
usage  
of the Logging::Logger#add method to use the new  
Logging::Logger#add\_appenders method (it’s the old “add” method  
renamed to “add\_appenders”).

== Installation

sudo gem install logging

== What’s Important

Logging provides a few niceties

1. a rolling file appender than can handle multiple processes logging  
to the same file
2. a nice e-mail appender
3. sending log messages to Growl (for those on the Mac platform)
4. fine grained control over logging levels for specific classes

== Changes

1 major enhancement

- Rails compatibility
  - renamed Logger#add method to Logger#add\_appenders
  - renamed Logger#remove method to Logger#remove\_appenders
  - renamed Logger#clear method to Logger#clear\_appenders
  - added a new Logger#add method that conforms to the calling  
semantics of the Ruby stdlib Logger

2 minor enhancements

- Speed improvements and test coverage
- Created a top-level Logging.init method that is used to  
define the default logging levels

1 bug fix

- Tweaked windows detection code

== Fun Fact

A pregnant goldfish is called a “twit”.

== Post Script

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:** [February 13, 2008, 5:23am UTC](https://www.ruby-forum.com/t/logging-0-7-0-quixotic-starfish/128968/2 "2008-02-13T05:23:26Z")

</div>

On Feb 12, 2008, at 7:21 PM, Tim P. wrote:

> 1. a rolling file appender than can handle multiple processes logging  
> to the same file

Forgive my being too lazy to look to night, but what does this mean?  
Would this feature make it possible to make something like Rails  
logging multiprocess safe?

Obviously I only ask because this project looks freaking awesome Tim.

James Edward G. II

---

<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:** [February 13, 2008, 4:59pm UTC](https://www.ruby-forum.com/t/logging-0-7-0-quixotic-starfish/128968/3 "2008-02-13T16:59:15Z")

</div>

On Feb 12, 2008, at 9:22 PM, James G. wrote:

> On Feb 12, 2008, at 7:21 PM, Tim P. wrote:
> 
> > 1. a rolling file appender than can handle multiple processes logging  
> > to the same file
> 
> Forgive my being too lazy to look to night, but what does this  
> mean? Would this feature make it possible to make something like  
> Rails logging multiprocess safe?

That is correct. Multiple Rails processes (i.e. mongrel clusters) can  
now safely log to the same file, have the file roll, and all the  
processes will use the newer log file.

You can also use the Syslog appender in Logging and dump to the syslog  
service. This is good for collecting logs from multiple machines.

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:** [February 21, 2008, 7:47am UTC](https://www.ruby-forum.com/t/logging-0-7-0-quixotic-starfish/128968/4 "2008-02-21T07:47:00Z")

</div>

On Wed, Feb 13, 2008 at 3:21 AM, Tim P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> == Logging  
> by Tim P.  
> [http://logging.rubyforge.org](http://logging.rubyforge.org)  
> (the “Quixotic Starfish” release)

I see you are making use of the Ubuntu naming convention 😉  
To automate that, you may want to try FireSomething:  
[https://addons.mozilla.org/en-US/firefox/addon/31](https://addons.mozilla.org/en-US/firefox/addon/31)

Actually I wonder if the adjective-animal namespace might get crowded.  
Perhaps a new class is in order:  
Juicy Jacaranda  
Bearded Beech  
etc.

---

<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:** [February 21, 2008, 1:11am UTC](https://www.ruby-forum.com/t/logging-0-7-0-quixotic-starfish/128968/5 "2008-02-21T01:11:54Z")

</div>

On Feb 13, 7:58 am, Tim P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> That is correct. Multiple Rails processes (i.e. mongrel clusters) can  
> now safely log to the same file, have the file roll, and all the  
> processes will use the newer log file.
> 
> You can also use the Syslog appender in Logging and dump to the syslog  
> service. This is good for collecting logs from multiple machines.

What’s the best way to configure Rails to use Logging? Is there any  
documentation for setting it up?

I looked at  
[http://wiki.rubyonrails.org/rails/pages/HowtoConfigureLogging](http://wiki.rubyonrails.org/rails/pages/HowtoConfigureLogging)  
but it only talks about log4r.

Will.
