Hi Frank, I applied the slf4j-converter on BarracudaMVC with relative success. Most classes could be converted fine, with the following exceptions:
1) Log statements using the FATAL level were not converted. However, it took me only a few minutes to convert them manually to the ERROR level. 2) I had to import org.slf4j.MDC in classes where log4j's MDC was used. 3) In the ApplicationGateway class I had to remove the second argument of type org.apache.log4j.Level in the logRequetDetails() method. Subsequently, a small number of other classes calling this method also has to be modified. It not too hard to imagine the refactorings that one would apply to do things properly. 4) I had to comment out calls to DOMConfigurator which does not have an equivalent in SLF4J. It took me less than 10 minutes to perform the conversion, including the manual steps. (To put things in perspective, this email took longer than that to write). As far as I can tell, only step 4 (call to DOMConfigurator) requires further explanation. There are only two such calls in the whole project, in the DefaultApplicationAssembler and ObjectRepositoryAssembler classes. If these classes are not absolutely needed, then you could place them in an optional package, so that the dependency on log4j becomes optional as well. If these classes are mandatory, then you have a strong dependency on log4j. However, it has been isolated to within two classes. Your comments are welcome, Franck Routier wrote: > BarracudaMVC uses quite extensively Log4j. > It is built with ant and has test cases. > > Also, using log4j-over-slf4j results in bug 66 : > http://bugzilla.slf4j.org/show_bug.cgi?id=66 > > So it might be a good test. > > You can download the source via subversion at > svn://svn.forge.objectweb.org/svnroot/barracudamvc/Barracuda2/trunk > and the build.xml file can be found in WEB-INF/bin/build.xml > > Franck > > -- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch _______________________________________________ user mailing list [email protected] http://www.slf4j.org/mailman/listinfo/user
