-
1. Re: slf4j
nickarls Mar 27, 2010 6:50 PM (in response to asookazian)Weld has a SL4J logger extension that will probably be user for Seam 3 also
-
2. Re: slf4j
dan.j.allen Mar 27, 2010 7:19 PM (in response to asookazian)
Nicklas Karlsson wrote on Mar 27, 2010 18:50:
Weld has a SL4J logger extension that will probably be user for Seam 3 alsoI'll make that statement more definitive. Seam 3 modules will use the SL4J logger extension :)
import org.slf4j.Logger; ... @Inject Logger log;
Please be aware that there is currently a classloading problem with SLF4J that you may run into on JBoss AS. I'll explain the problem and the solution.
Problem
weld-extensions includes slf4j-api as a compile time dependency and Seam 3 modules (that use the logger extension) bring in weld-extensions. That means that slf4j-api will end up in your archive (by default). If you deploy just the API, you will get a startup error in JBoss AS 6.0 M2 because the SLF4J library is already on the server and exposed to the application.
Solution
The temporary solution is to include slf4j-jdk14 as a runtime dependency. This bridge to JDK logging prevents conflicts between the two SLF4J libraries. Seam 3 parent now includes slf4j-jdk14 as a runtime dependency as a sensible default until we can figure out the proper solution. (The other workaround would have been to exclude slf4j-api, but then you would be assuming that the server provides SLF4J -> non-portable).