Hi Thomas,

Yes I have reference in the catalina.sh to the log4j.properties file:

LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/log4j.properties"

this is what I get in the catalina.out on restart:

INFO: Configuring Log4j from File:
/data/apache-tomcat-6.0.29/webapps/application/WEB-INF/etc/log4j-configuration.xml
19/04/2011 4:16:24 PM org.apache.catalina.core.ApplicationContext log
INFO:  Log4J context Initialized

where log4j-configuration.xml is the application XML file located as given
in the above log line. So that is being loaded ok.

If I remove CONSOLE from the list of root loggers, isn't this going to
prevent anything from being logged in the catalina.out file? I would like to
keep the useful info from the restart process.

Thanks,
Igor

On Mon, Apr 18, 2011 at 4:54 PM, Thomas Freitag <tho...@freit.ag> wrote:

> -----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