[slf4j-dev] Review of slf4j

Jacob Kjome hoju at visi.com
Sun May 15 04:55:47 CEST 2005


At 02:50 PM 5/14/2005 +0200, you wrote:
 >At 16:22 5/11/2005, Niclas Hedhman wrote:
 >>On Wednesday 11 May 2005 16:21, Ceki Gülcü wrote:
 >> > I intent to stop and think about this problem in more depth, in 
particular
 >> > after studying the Spring Framework. Would you recommend any other
 >> > frameworks worth looking at?
 >>
 >>Spring promotes setter injection for everything.
 >>Pico promotes constructor injection for everything.
 >>
 >>In both cases, it is about the framework preparing the instance to be passed
 >>to the user object, i.e. basic Inversion-of-Control.
 >>
 >>So, I assume that it would cover the basics of IoC.
 >
 >After going through about a one third of the Spring Framework manual, I
 >still don't see why anyone would want to manage their loggers through IOC.
 >Loggers cut through all object instances in a project. Thus, who in their
 >right minds would want to configure their loggers using a BeanFactory with
 >some underlying XML file as specification? Why would anyone trade a
 >programming language like java to manage objects for something as clumsy as
 >a XML config file?
 >

Well, whether one uses XML or something else to do configuration is 
somewhat beside the point.  The most common way to configure Picocontainer 
is to use the Groovy language.  A number of Picocontainer's contributors 
have voiced clear distaste for XML as a configuration mechanism but seem to 
love using Groovy (or any one of the other scripting languages supported 
under Java, actually).  There is no reason Spring couldn't be managed via a 
groovy config file where the language looks an awful lot like Java and has 
every bit of the power of Java to boot.

 >Admittedly, I still don't get it. Well, there are obvious advantages to
 >managing some objects with a framework like Spring, but managing something
 >as fine-grained as a logger? Would you manage String objects using Spring?
 >I don't think so...
 >

Spring is for managing components.  All IOC frameworks are for managing 
components.  I don't think a simple String could be mistaken for a 
component.  I'm torn on whether loggers are?  I argued a while back for it 
until you came up with UGLI.  My objection back then was that UGLI didn't 
yet exist and I wasn't sure it ever would.  You made it happen and it has 
evolved into slf4j.  With the drop-in replacements for logging 
implementations including simple and even NOP, I'm not sure I see the need 
to clutter the interface with loggers.


Jake

 >
 >>Cheers
 >>Niclas
 >
 >--
 >Ceki Gülcü
 >
 >   The complete log4j manual: http://www.qos.ch/log4j/
 >
 >
 >_______________________________________________
 >dev mailing list
 >dev at slf4j.org
 >http://slf4j.org/mailman/listinfo/dev
 >
 >  




More information about the slf4j-dev mailing list