cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Pötz <>
Subject [c3] Log*Transformer
Date Fri, 18 Feb 2011 19:28:47 GMT

I had to comment the usage of the Log*Transformers in the sample sitemap 
because they break the integration tests (run or it.bat from C3's 
root directory). The problem is that the logfile is written to the file 
system which doesn't work in a multi-module build (<map:parameter 
name="logfile" value="target/logasxml.log" /> -> there is no target 
directory at the base directory).

IMO the best idea would be changing the transformer configurations to 
use System.out but the current implementations close the output stream 
in their finish methods. That's of course useful for FileOutputStreams 
but mustn't happen for System.out.

IMO the best solution would be wrapping the usage of System.out with 
Commons IO's CloseShieldOutputStream 
( However, 
this would introduce a dependency of cocoon-sax on commons-io which 
should be avoided for a minor use case like this.

I see two possible solutions:

a) move the Log*Transformers to cocoon-optional and wrap the usage
    of System.out with the CloseShieldOutputStream

b) implement the CloseShield functionality ourselves and leave them
    where they are.

I would prefer option a) because it's the simpler solution and leads to 
less code.


Reinhard Pötz         Founder & Managing Director, Indoqa and Deepsearch

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member        

       Furthermore, I think Oracle has to honor the JSPA agreement.

View raw message