Feature Requests: Browse | Submit New | Admin

[#27464] Allow outputters in root logger

Date:
2009-11-20 13:08
Priority:
3
Submitted By:
Jochen S (jochens)
Assigned To:
Colby Gutierrez-Kraybill (colbygk)
Category:
None
State:
Open
Summary:
Allow outputters in root logger

Detailed description
Currently, RootLogger overwrites outputters= and disallows any outputters being appended to it. This means that you
cannot configure a "global" outputter for all loggers used in the system.

Which would be very convenient if you could to that...

Regards,
Jochen Seeber

Add A Comment: Notepad

Please login


Followup

Message
Date: 2010-12-10 03:08
Sender: Kevin Nardi

I'm sorry, I spoke too soon. Here is a workaround that actually
works (around):
Log4r::Logger.root.outputters << Log4r::Outputter.stdout
class Log4r::RootLogger
  def is_root?; false; end
end
Log4r::Logger::LoggerFactory.define_methods(Log4r::Logger.root)
Date: 2010-12-10 01:59
Sender: Kevin Nardi

Here's a workaround. Before any other loggers get defined, run
this:
Log4r::Logger.root.outputters << Log4r::Outputter.stdout
Log4r::Logger::LogFactory.toggle_methods(Log4r::Logger.root.level,
Log4r::Logger.root)

(Replace the outputter in the first line to output to wherever
you want.)
Date: 2010-12-09 02:20
Sender: Kevin Nardi

A very big +1. It seems like Log4r, unlike Log4j, missed the
whole point of having a hierarchical logging system.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2010-02-09 02:57colbygk