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: org.apache.logging.log4j.spi.AbstractLogger.FQCN
Date Fri, 14 Jun 2013 14:20:30 GMT
On Fri, Jun 14, 2013 at 9:27 AM, Nick Williams <
nicholas@nicholaswilliams.net> wrote:

> Yea. If a class that extends AbstractLogger calls the logging method that
> takes the FQCN (for example, overrides a "debug" method), it needs to use
> its /own/ private static FQCN variable. But the AbstractLogger needs one
> that is AbstractLogger instead of the implementing class.
>

Well, is this Javadoc in
org.apache.logging.log4j.spi.AbstractLogger.log(Marker, String, Level,
Message, Throwable) wrong then?

    /**
     * Logs a message with location information.
     *
     * @param marker The Marker
     * @param fqcn   The fully qualified class name of the <b>caller</b>
     * @param level  The logging level
     * @param data   The Message.
     * @param t      A Throwable or null.
     */
    protected abstract void log(Marker marker, String fqcn, Level level,
Message data, Throwable t);

If fqcn is always org.apache.logging.log4j.spi.AbstractLogger, then it is
NOT the "The fully qualified class name of the <b>caller</b>."

Gary

>
> On Jun 14, 2013, at 8:20 AM, Ralph Goers wrote:
>
> Because this.getClass().getName() doesn't work.
>
> When searching for the class in the stack AbstractLogger is what will show
> up since that is where the method is defined.
>
> Ralph
>
> On Jun 14, 2013, at 5:57 AM, Gary Gregory wrote:
>
> Hi All:
>
> Why is org.apache.logging.log4j.spi.AbstractLogger.FQCN defined as:
>
> private static final String FQCN = AbstractLogger.class.getName();
>
> instead of:
>
> private final String FQCN = this.getClass().getName();
>
> Gary
>
> --
> 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
>
>
>
>


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

Mime
View raw message