logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: Extending loggers
Date Tue, 04 Mar 2014 13:47:59 GMT
Hi Bruce,

Can you create a JIRA and attach your code there? I think it will make it
easier to track. Or better yet, create a branch if you think the experiment
will be long lived enough.


On Tue, Mar 4, 2014 at 8:26 AM, Bruce Brouwer <bruce.brouwer@gmail.com>wrote:

> There are a number of JIRAs out there that have issues related to making
> sure we get the correct caller location logged. I'm attaching a patch which
> is in no way complete but demonstrates an idea that might make it easier to
> extend loggers. For example, this makes the slf4j-impl quite a bit simpler.
> It also impacts the jcl code, which I don't think was working to record the
> caller location.
> The idea is to create a LoggerExtension from the original logger which
> simply remembers the FQCN that will ultimately be the extension. Also by
> doing this, we can switch a bunch of methods that ended up being public
> back to protected. I'm guessing they became public so extensions could call
> them.
> I also like how extensions (such as slf4j, jcl, custom extensions, logger
> streams) don't have to pass in the FQCN to that special log method anymore.
> Also, you don't have to wrap every extended log method with a check to see
> if the logging is enabled. Finally, you don't need to have any access to
> the MessageFactory.
> This is very much a work in progress, but please take a look (but don't
> commit it as is) and give me your thoughts. I think it could help with some
> of the issues we've been seeing. But if it is too much
> --
> Bruce Brouwer
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org

E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

View raw message