Framework

Method 1

Method 2

Method 3

SLF4J

LoggerFactory.getLogger

XLoggerFactory.getXLogger

 

Log4j 1.x

LogManager.getLogger

Logger.getLogger

Category.getLogger

Log4j 2

LogManager.getLogger

 

 

Commons Logging

LogFactory.getLog

 

 

java.util.logging

LogManager.getLogger

 

 


In addition to what I said below I'm thinking that when I made the choice I 
also took into account what Log4j 1.x was already doing (minus allowing factory 
methods in non-factory classes).

I guess Scott's point is that since they are the same the work to port is 
reduced.  So I guess my opinion is to leave it as it is.

Ralph



On Nov 4, 2012, at 11:51 AM, Scott Deboy wrote:

> There is also the fact that it makes code conversion from log4j to log4j2 
> less painful by reusing the same call to get a logger.
> 
> Scott
> 
> On Nov 4, 2012 11:20 AM, "Gary Gregory" <garydgreg...@gmail.com> wrote:
> I'm wondering if such a "root" class would benefit being called "Log4J" or 
> ""Log4J2".
> 
> final Logger logger = Log4J.getLogger(Foo.class);
> final Logger logger = Log4J2.getLogger(Foo.class);
> final Logger logger = LogManager.getLogger(Foo.class);
> 
> With all the logging framework on the classpath of a large project, having a 
> clear non-generic name would be good thing.
> 
> Thoughts?
> 
> Gary
> 
> On Sun, Nov 4, 2012 at 10:26 AM, Ralph Goers <rgo...@apache.org> wrote:
> Because SLF4J uses LoggerFactory and I thought it would be confusing to reuse 
> it and I just didn't like the way LoggerManager sounds.
> 
> Ralph
> 
> On Nov 4, 2012, at 6:13 AM, Gary Gregory <garydgreg...@gmail.com> wrote:
> 
>> Hi All:
>> 
>> We have LogManager but the class serves Logger objects. Why did we pick this 
>> name vs any other like LoggerManager or LoggerFactory?
>> 
>> Gary
>> -- 
>> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org 
>> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
>> Spring Batch in Action: http://bit.ly/bqpbCK
>> Blog: http://garygregory.wordpress.com 
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
> 
> 
> 
> -- 
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org 
> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
> Spring Batch in Action: http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

Reply via email to