camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davsclaus <cib_re...@yahoo.dk>
Subject Maven and commons-logging-api and the dreadful log4j problem
Date Thu, 06 Mar 2008 06:21:39 GMT

Hi

I have been working on some patches for camel-mina as we needed camel to
support synchronous TCP communication and the likes.

During unit testing I was fighting to output DEBUG logging using
log4j.properties. It took quite a while for me to figure out that log4j is
not picked up/used at all during unit testing since the pom.xml that are
used default in camel depends on:

      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging-api</artifactId>
        <version>1.0.4</version>
      </dependency>

And apparently there is a difference when the artifcatid is -api
(commons-logging-api). The it does not include the Log4jFactory and then you
are stuck with lame JDK1.4 logging.


To remedy it I had to set this in the pom.xml in camel-mina component

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <scope>test</scope>
    </dependency>

This is the non -api version that includes the Log4jFactory and others.
Then the log4j.properties from test/resources is picked up and I can have
DEBUG logging from all the frameworks used (even Mina).

Changing the uber pom.xml to use the non -api did not work AFAIR - there
were some maven build problems later on. 


Is there a sane reason why JCL has this abstraction between the -api and non
api version where the most used logging framework is excluded?


I just wanted to raise this on this forum. How does the camel developers go
around this? I am sure there are others that have had similar problems.
-- 
View this message in context: http://www.nabble.com/Maven-and-commons-logging-api-and-the-dreadful-log4j-problem-tp15867257s22882p15867257.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message