Feature Requests: Browse | Submit New | Admin
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:
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.