# Logging 0.1.0

**URL:** <https://www.ruby-forum.com/t/logging-0-1-0/81872>\
**Category:** Ruby\
**Created:** [January 15, 2007, 9:53pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872 "2007-01-15T21:53:07Z")\
**Posts on this page:** 9\
**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:** [January 15, 2007, 9:53pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872/1 "2007-01-15T21:53:07Z")

</div>

SYNOPSIS

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.

Logging is intended to supersede the orphaned Log4r project.

INSTALL

To install:

```
$ gem install logging

```

A tarball is also available on the RubyForge project page:

```
http://rubyforge.org/projects/logging/

```

EXAMPLE

```
require 'rubygems'
require 'logging'
include Logging

log = Logger.new 'test'
log.appenders = Appender.stdout
log.level = 'info'

log.debug 'debug message'
log.info 'informational message'
log.warn 'Danger! Danger! Will Robinson'
log.error {
   # ... some very time consuming code goes here
   'this log message took a long time to construct'
}
log.fatal 'Die Die Die'

```

The following lines are printed to STDOUT

```
 INFO test : informational message
 WARN test : Danger! Danger! Will Robinson
ERROR test : this log message took a long time to construct
FATAL test : Die Die Die

```

NOTES

Although Logging is intended to supersede Log4r, it is not a one-to-one  
replacement for the Log4r library. Most notably is the difference in  
name spaces  
– Logging vs. Log4r. Other differences include renaming  
Log4r::Outputter to  
Logging::Appender and renaming Log4r::Formatter to Logging::Layout.  
These  
changes were meant to bring the Logging class names more in line with  
the Log4j  
class names.

This is an alpha release, and as such it is not yet feature complete.  
Neither  
the YAML configuration nor the XML configuration have been incorporated  
into the  
Logging library. Not all the logging appenders have been incorporated  
into the  
Logging library either. If you would like to port any code from Log4r  
please  
contact me (contact info can be found in the gem specification).

---

<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:** [January 15, 2007, 11:15pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872/2 "2007-01-15T23:15:25Z")

</div>

Yes ! A decent ruby logger. I was waiting for this since a long time.

Are you going to fix the syslog adapter ? In Log4r, when you used  
syslog, it  
would change the error level and reporting methods. It’s pretty  
annoying.

---

<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:** [January 15, 2007, 11:23pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872/3 "2007-01-15T23:23:27Z")

</div>

On 1/15/07, Jonas P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Yes ! A decent ruby logger. I was waiting for this since a long time.

Hmmm … I would download the code first and poke around … kick the  
wheels. But thanks for the exuberance 🙂

> Are you going to fix the syslog adapter ? In Log4r, when you used syslog, it  
> would change the error level and reporting methods. It’s pretty annoying.

Sure. The field is wide open at the moment. I’m looking for  
suggestions / requests from developers.

My thought on syslog is to require a mapping from the user that maps  
the defined logging levels to the syslog logging levels. If the user  
has not defined any logging levels, then the syslog levels become the  
default (i.e. the current Log4r behavior).

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:** [January 16, 2007, 8:30pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872/4 "2007-01-16T20:30:23Z")

</div>

On 1/16/07, Jonas P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> No problem, I’ve tried to contact the Log4r developper regarding some bugs
> 
> > suggestions / requests from developers.  
> > logging.tgz file, as package names are locked to a project for security  
> > reasons.

They are doing some security audits / updates on RubyForge right now.  
Gems are not being migrated over for distribution until they are done  
with this. You can manually download the gem and install it if you  
would like to tinker.

[http://rubyforge.org/frs/?group\_id=2870](http://rubyforge.org/frs/?group_id=2870)

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:** [January 16, 2007, 8:14pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872/5 "2007-01-16T20:14:20Z")

</div>

2007/1/15, Tim P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> On 1/15/07, Jonas P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Yes ! A decent ruby logger. I was waiting for this since a long time.
> 
> Hmmm … I would download the code first and poke around … kick the  
> wheels. But thanks for the exuberance 🙂

No problem, I’ve tried to contact the Log4r developper regarding some  
bugs  
and I’m happy that the project revives. I have a big project and once  
I’ve  
added Log4r support, it became much easier to debug.

> the defined logging levels to the syslog logging levels. If the user  
> has not defined any logging levels, then the syslog levels become the  
> default (i.e. the current Log4r behavior).

Ok, I’ll let you know on this. In the meantime, can you check why the  
loggging gem is not available ? I think you should contact rubyforge  
people.  
It’s maybe related to the fact that somebody else already released a  
logging.tgz file, as package names are locked to a project for security  
reasons.

Cheers,  
zimbatm

---

<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:** [January 17, 2007, 11:53pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872/6 "2007-01-17T23:53:56Z")

</div>

On Wed, 2007-01-17 at 04:13 +0900, Jonas P. wrote:

> Ok, I’ll let you know on this. In the meantime, can you check why the  
> loggging gem is not available ? I think you should contact rubyforge people.  
> It’s maybe related to the fact that somebody else already released a  
> logging.tgz file, as package names are locked to a project for security

Nah, only gems are affected by the namespace thing since they are the  
only things for which RubyForge builds an index. All the other files  
are “scoped” by their project’s name.

Yours,

Tom

---

<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:** [January 19, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872/7 "2007-01-19T16:31:37Z")

</div>

On Wed, 2007-01-17 at 17:53 -0500, Tom C. wrote:

> On Wed, 2007-01-17 at 04:13 +0900, Jonas P. wrote:
> 
> > Ok, I’ll let you know on this. In the meantime, can you check why the  
> > loggging gem is not available ? I think you should contact rubyforge people.  
> > It’s maybe related to the fact that somebody else already released a  
> > logging.tgz file, as package names are locked to a project for security
> 
> Nah, only gems are affected by the namespace thing since they are the  
> only things for which RubyForge builds an index. All the other files  
> are “scoped” by their project’s name.

By the way, I added a section to the RubyForge FAQ on this whole  
RubyForge gem index/namespace issue:

[http://rubyforge.org/docman/view.php/5/460/faq.html#gemnamespace](http://rubyforge.org/docman/view.php/5/460/faq.html#gemnamespace)

Comments/questions welcome,

Yours,

tom

---

<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:** [September 25, 2007, 10:34pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872/8 "2007-09-25T22:34:23Z")

</div>

2007/1/19, Tom C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > Nah, only gems are affected by the namespace thing since they are the  
> > only things for which RubyForge builds an index. All the other files  
> > are “scoped” by their project’s name.
> 
> By the way, I added a section to the RubyForge FAQ on this whole  
> RubyForge gem index/namespace issue:
> 
> [http://rubyforge.org/docman/view.php/5/460/faq.html#gemnamespace](http://rubyforge.org/docman/view.php/5/460/faq.html#gemnamespace)
> 
> Comments/questions welcome,

Thanks for all the time you took to solve that issue. Your solution  
looks  
right

---

<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:** [September 25, 2007, 10:52pm UTC](https://www.ruby-forum.com/t/logging-0-1-0/81872/9 "2007-09-25T22:52:28Z")

</div>

On Fri, 2007-01-19 at 16:56 +0900, Jonas P. wrote:

> > By the way, I added a section to the RubyForge FAQ on this whole  
> > RubyForge gem index/namespace issue:
> > 
> > [http://rubyforge.org/docman/view.php/5/460/faq.html#gemnamespace](http://rubyforge.org/docman/view.php/5/460/faq.html#gemnamespace)
> > 
> > Comments/questions welcome,
> 
> Thanks for all the time you took to solve that issue. Your solution looks  
> right

Thanks! I’m just glad that security hole has been found and closed.

Yours,

Tom
