You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gintare Ragaisiene <gi...@gmail.com> on 2009/06/11 11:12:09 UTC
cocoon 2.2 war app logging + Tomcat 6
Hello,
I've deployed cocoon 2.2 WAR application into Tomcat 6. The problem is, that
WAR contains my custom-made block "myclubbingguide.jar" and errors from this
blocks is not visible nor in the logs/catalina.out nor in the
cocoon-logs/log4j.log.
So , again, my webbapp structure is:
WAR app
|
+----myclubbingguide.jar block
|
+...ather libraries
I've reasearched this:
1)
myclubbingguide.jar block has custom log4j.xml :
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="CORE" 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>
<root>
<priority value="error"/>
<appender-ref ref="CORE" />
</root>
</log4j:configuration>
and when it runs separately from war throught "mvn jetty:run", then logging
works ok.
2)
when I run WAR app with "mvn jetty:run", the log messages apears in console
either. And it's ok.
3)
when I run WAR deployed on Tomcat 6, Syste.out.println() messages goes to
logs/catalona.out, but no error messages from myclubbingguide.jar block can
be viewed. And it is a problem.
Why Tomcat don't listens block's log4 setup? Is there must be log4j.xml or
web.xml or some ather file of WAR edited? Where I should exepect those error
messages to apear?
Thank you,
regards,
Gintare
Re: cocoon 2.2 war app logging + Tomcat 6
Posted by Barbara Slupik <ba...@wro.vectranet.pl>.
Hello
I have this:
<bean name="org.apache.cocoon.spring.configurator.log4j"
class="org.apache.cocoon.spring.configurator.log4j.Log4JConfigurator"
scope="singleton">
<property name="settings"
ref="org.apache.cocoon.configuration.Settings"/>
<property name="resource" value="/WEB-INF/log4j.xml"/>
</bean>
in my application context.
My log4j.xml is in my cocoon-webapp/src/main/webapp/WEB-INF and it
contains:
<appender name="APPLICATION"
class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${org.apache.cocoon.work.directory}/
cocoon-logs/application.log" />
<param name="Append" value="false" />
<param name="MaxFileSize" value="4096KB"/>
<param name="MaxBackupIndex" value="1"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %t %-5p %c{2} - %m%n"/>
</layout>
</appender>
...
<category name="my.package">
<priority value="DEBUG" />
<appender-ref ref="APPLICATION"/>
</category>
This works for me in tomcat.
Barbara
On 11 Jun, 2009, at 11:12 am, Gintare Ragaisiene wrote:
> Hello,
>
> I've deployed cocoon 2.2 WAR application into Tomcat 6. The problem
> is, that WAR contains my custom-made block "myclubbingguide.jar" and
> errors from this blocks is not visible nor in the logs/catalina.out
> nor in the cocoon-logs/log4j.log.
>
> So , again, my webbapp structure is:
>
> WAR app
> |
> +----myclubbingguide.jar block
> |
> +...ather libraries
>
> I've reasearched this:
>
> 1)
> myclubbingguide.jar block has custom log4j.xml :
>
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
>
> <appender name="CORE" 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>
>
> <root>
> <priority value="error"/>
> <appender-ref ref="CORE" />
> </root>
> </log4j:configuration>
>
> and when it runs separately from war throught "mvn jetty:run", then
> logging works ok.
>
> 2)
> when I run WAR app with "mvn jetty:run", the log messages apears in
> console either. And it's ok.
>
> 3)
> when I run WAR deployed on Tomcat 6, Syste.out.println() messages
> goes to logs/catalona.out, but no error messages from
> myclubbingguide.jar block can be viewed. And it is a problem.
>
>
> Why Tomcat don't listens block's log4 setup? Is there must be
> log4j.xml or web.xml or some ather file of WAR edited? Where I
> should exepect those error messages to apear?
>
>
> Thank you,
> regards,
> Gintare