-
1. Re: Weld logging
mkouba Sep 29, 2014 4:10 AM (in response to emilyj)Hi Emily,
jboss-logging itself is ASL2. jboss-logmanager is not necessary, it's just one of the supported logging providers (others include log4j, slf4j, jul). Simply put a more suitable provider on the classpath. jboss-logging-processor shouldn't be necessary either - it contains an annotation processor which generates classes used in the runtime (see also JBoss Logging Tooling). Anyway, it's LGPL, so it should be safe to use in most OSS or proprietary applications.
-
2. Re: Weld logging
emilyj Sep 29, 2014 5:28 AM (in response to mkouba)Thank you Martin for your reply. It would be ideal for me if I don't reply on jboss-logmanager. However, without it, I cannot resolve the class org.jboss.weld.logging.BeanLogger as it imports org.jboss.logging.annotation, which defined in the jboss-logmanager. How can I swap it out? I have slf4j in my runtime. It will be great if I can config weld logging to use slf4j but some logging classes seem to import log4j packages. I had to pull in log4j as well, which is quite sticky. Unfortunately the JBoss Logging Tooling link did not give a pointer about how to resolve this. Any more suggestions will be very much appreciated!
-
3. Re: Weld logging
mkouba Sep 29, 2014 5:40 AM (in response to emilyj)What version of Weld and jboss-logging do you use? org.jboss.logging.annotations package was originally part of the jboss-logging jar and now it's included in jboss-logging-processor. jboss-logmanager is definitely not required. Also Weld classes don't import log4j packages. Anyway, if you want to skip the logging provider detection and force the use of slf4j use the following system property: -Dorg.jboss.logging.provider=slf4j (see also http://grepcode.com/file/repo1.maven.org/maven2/org.jboss.logging/jboss-logging/3.1.4.GA/org/jboss/logging/LoggerProvide…)
-
4. Re: Weld logging
emilyj Sep 29, 2014 5:57 AM (in response to mkouba)Thanks Martin for your quick reply! I am using weld 2.2.5.final. In the weld core impl jar (http://mvnrepository.com/artifact/org.jboss.weld/weld-core-impl/2.2.5.Final), it lists the dependency on jboss-logmanager. It looks like the logging version is 3.1.3. I am using the jars in an OSGi environment, so I need to provide all the dependencies so that it can be resolved. As you can see, the weld core impl depends on both slf4j and log4j. Therefore, I had to supply both. Did I miss anything?
-
5. Re: Weld logging
mkouba Sep 29, 2014 6:35 AM (in response to emilyj)1 of 1 people found this helpfulYes, but it has the test dependency scope. Similarly jboss-logging-processor has the provided scope. See also http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html. I cannot see log4j or slf4j on the weld-core-impl dependency list.
-
6. Re: Weld logging
mkouba Sep 29, 2014 6:38 AM (in response to emilyj)Furthermore, there's a Weld runtime packaged as an OSGi bundle available: http://search.maven.org/#artifactdetails|org.jboss.weld|weld-osgi-bundle|2.2.5.Final|jar
-
7. Re: Weld logging
emilyj Sep 30, 2014 5:54 AM (in response to mkouba)Thank you Martin! You were right that logmanager is not required. My dependencies has certainly shrinked after removing it and its dependencies. As for the Weld OSGi bundle, is it a aggregation of all modules except java se bit?
-
8. Re: Weld logging
mkouba Sep 30, 2014 7:06 AM (in response to emilyj)Emily Jiang napsal(a):
Thank you Martin! You were right that logmanager is not required. My dependencies has certainly shrinked after removing it and its dependencies. As for the Weld OSGi bundle, is it a aggregation of all modules except java se bit?
It contains all Weld core parts (API, SPI, core implementation, ...) and JBoss Class File Writer (bytecode manipulation library).