You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by hussayn <hu...@saxess.com> on 2008/09/08 13:32:59 UTC
howto customize cocoon-2.2 logging ?
Hi;
I am searching for the correct place to change the loglevel for my
application.
But i can't figure out, where i have to add what. Apparently i would not
do any changes in the target folder, becasue this would be overwritten with
my next
mvn jetty:run call ?
I only want to get rid of the DEBUG entries, which are generated about every
2 seconds
and sum up to Gigabytes of logfiles. Is there any pointer to some explaining
documentation ?
thanks for any help.
regards, hussayn
--
View this message in context: http://www.nabble.com/howto-customize-cocoon-2.2-logging---tp19370191p19370191.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: howto customize cocoon-2.2 logging ?
Posted by hussayn <hu...@saxess.com>.
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...
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="stdout" class="org.apache.log4j.ConsoleAppender">
<param name="target" value="System.err"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601} %c{2}
%p - %m%n"/>
</layout>
</appender>
<logger name="cocoon">
<level value="INFO" />
</logger>
<logger name="org.apache.cocoon.components.flow.javascript.fom">
<level value="INFO" />
</logger>
<root>
<priority value="WARN"/>
<appender-ref ref="stdout"/>
</root>
</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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org