Sure. SLF4J requires that StaticLoggerBinder, StaticMarkerBinder and StaticMDCBinder be implemented with specific package and class names - it looks for them in the class path to determine the implementation of the API (Note that this is different than how I've implemented the Log4j 2 API - it binds by looking for a log4j-provider.xml and getting the class names from it). In order for MarkerWrapper to extend BasicMarker it has to be in the same package since BasicMarker's constructor is package protected. Since MarkerWrapper's constructor is protected Log4JMarkerFactory needs to be in the same package. Log4JLoggerFactory and Log4JMDCFactory could have been in any package but since they implement SLF4J interfaces keeping them together with the other classes just made sense to me. As for Log4JLogger, it too could be in any package but it is tied to both the SLF4J API and the Log4J2 API and keeping it in the org.slf4j package makes it clear it isn't directly part of the Log4J 2 implementation.
In short, to implement the SLF4J API using the org.slf4j namespace is unavoidable. Ralph On Feb 6, 2011, at 9:26 PM, Curt Arnold wrote: > Could you provide some background on the use of the org.slf4j namespace in > the commit? > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
