I found a solution here: 

http://happygiraffe.net/blog/2008/08/27/logging-in-cocoon-22/
http://www.nabble.com/logging-with-C2.2-td13423869.html

My synthesis is:

1.) Add a configuration entry into the pom.xml of your block.
     Search for the plugin with the artifact id "cocoon-maven-plugin"

     I added a configuration tag to the end of the plugin. The whole plugin
now looks like this:

      <plugin>
        <groupId>org.apache.cocoon</groupId>
        <artifactId>cocoon-maven-plugin</artifactId>
        <version>1.0.0-M2</version>
        <executions>
          <execution>
            <id>prepare</id>
            <phase>compile</phase>
            <goals>
              <goal>prepare</goal>
            </goals>
          </execution>
        </executions>

        <!-- =========================================== -->
        <!-- HD: Added custom log4j configuration              -->
        <!-- The log4j-file gets copied to target/.../WEB-INF/log4j.xml -->
        <!-- =========================================== -->
        <configuration>
          
<customLog4jXconf>src/main/resources/WEB-INF/log4j.xml</customLog4jXconf>
        </configuration>

      </plugin>


2.) I created src/main/resources/WEB-INF/log4j.xml exactly as proposed by
the first link posted above.
Note: the specified folder is relative to the block root folder, so
"src/.../WEB-INF/log4j.xml" sounds good to me...

&lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    &lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>
        &lt;appender name="stdout" class="org.apache.log4j.ConsoleAppender">
            &lt;param name="target" value="System.err"/>
            &lt;layout class="org.apache.log4j.PatternLayout">
                &lt;param name="ConversionPattern" value="%d{ISO8601} %c{2}
%p - %m%n"/>
            &lt;/layout>
        &lt;/appender>
        &lt;logger name="cocoon">
            &lt;level value="INFO" />
        &lt;/logger>
        &lt;logger name="org.apache.cocoon.components.flow.javascript.fom">
            &lt;level value="INFO" />
        &lt;/logger>
        &lt;root>
            &lt;priority value="WARN"/>
            &lt;appender-ref ref="stdout"/>
        &lt;/root>
    &lt;/log4j:configuration>
  
After i restarted with mvn jetty:run , the customized log4j config works and
now i can customize log4j as i need...

Maybe that helps somebody else ;-)

regards, hussayn

-- 
View this message in context: 
http://www.nabble.com/howto-customize-cocoon-2.2-logging---tp19370191p19380787.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to