Hello,
I've been toying with something, and came across a subtle problem in
the poms which I propose to address with the attached diff:
Basically I've tried something with an external library which uses
slf4j, and for a moment was stunned that I couldn't get any logs at
all of that thing. It turned out that this is because Mifos has an
slf4j-nop.jar on it's CP, pulled in transitively from dbunit; c.f.
http://www.slf4j.org/manual.html about slf4j-nop: "Binding for NOP,
silently discarding all logging." (The slf4j-nop probably does not end
up in the Mifos.WAR, because it's only scope runtime, but for m2e it's
just another JAR to put on Eclipse' CP; and my problem was in the
workspace in JUnits & a test main).
Simply excluding slf4j-nop leads to an 'SLF4J: Failed to load class
"org.slf4j.impl.StaticLoggerBinder". / SLF4J: See
http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.' at startup (of e.g. unit tests in workspace; haven't tried
deploying WAR in Tomcat). As Hibernate seems to also have a dependency
on slf4j(-api), and as Mifos seems to use Log4j code for Logging
(
http://www.mifos.org/developers/wiki/LoggerConfiguration ?), I think
it probably makes sense to add that slf4j-log4j12 bridge then?
The attached proposed patch addresses this by an exclude for slf4j-nop
and adding a new dependency on slf4j-log4j12, with some fixes to
correctly use dependencyManagement at the top instead of repeating the
version (and exclusion) in every pom.xml, and I would like to suggest
it for integration.
I have NOT run the tests with this yet (slow!), may be one of you
could try? Should hopefully be fairly safe, I would think, at the
worst there could be some more (better!) logs from Hibernate printed
e.g. during Unit Tests (assuming that Hiberate logs only through
slf4j, and those got swallowed by slf4j-nop).
Regards,
Michael
_______________________
Michael Vorburger
http://www.vorburger.ch