-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Igor,

On 04/18/2011 08:23 AM, Igor Cicimov wrote:
> Hi Thomas,
> 
> First thanks for your reply. This is the relevant section in the
> $CATALINA_BASE/conf/log4j.properties file:

Do you use the JAva System Property
- -Dlog4j.configuration=file:$CATALINA_BASE/conf/log4j.properties to
reference this file? If not, it will never be loaded.

> 
> log4j.debug=true
> log4j.rootLogger=INFO, CATALINA, CONSOLE
> .
> .
> .
> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
> log4j.appender.CONSOLE.encoding=UTF-8
> log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
> log4j.appender.CONSOLE.DatePattern = '.'yyyy-MM-dd
> log4j.appender.CONSOLE.layout.conversionPattern=%d{ISO8601} - %X{login} -
> %X{device} - %X{uri} - %X{log} - %X{sessionId} - %m%n

Remove CONSOLE from the list of root loggers.

> and this is the log4j.properties file (relevant console section) for the
> application:
> 
>         <appender name="LOGOUT.CONSOLE"
> class="org.apache.log4j.DailyRollingFileAppender">
>                 <param name="File"
> value="$CATALINA_BASE/logs/application-console.log"/>
>                 <param name="Append" value="true"/>
>                 <param name="datePattern" value="'.'yyyy-MM-dd"/>
>                 <layout class="org.apache.log4j.PatternLayout">
>                         <param name="ConversionPattern" value="%d{HH:mm:ss}
> [%c] %m%n"/>
>                 </layout>
>         </appender>

This is a XML configuration, you can not mix this with a properties
configuration. Where is this file located WAR!WEB-INF/classes? If you
use the system property I mentioned before this file will never be loaded.

> but I can still see the application console output going into 'catalina.out'
> instead in the 'application-console.log' file which never gets created.

I don't believe your log4j configuration get loaded, check the
catalina.out for log4j debug messages (at least during Tomcat startup,
some lines with prefix "LOG4J" should appear).

> And this is what I have in the application context:
> 
> <Context .... swallowOutput="true"> .... </Context>
> 
> Thanks,
> Igorr,


Regards,
- -- 
Thomas Freitag
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk2r4C0ACgkQGE5pHr3PKuW+/ACeKaT7UbhhQHMe9G/gUlgnLuSv
+/YAn0z6AOITkg+v4QsjCxmC6vIxQHxz
=YwFi
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to