logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Kruzich <kkruz...@mshift.com>
Subject Re: Default Initialization under Tomcat (5, 6)
Date Thu, 15 Jul 2010 18:09:37 GMT


Thanks Jake -- My /etc/tomcat6/catalina.properties:

common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar

--but I'm unable to see where ${catalina.base} and ${catalina.home} are 
defined. That isn't so immediately relevant though.

At this point I have no preference as to whether the logging is server 
or app. I just want *something* --and I had that *something* with 
tomcat5 without too much trouble. What's most important to me is that I 
can see something running through syslog.

This isn't working for me:

 > /usr/share/tomcat6/lib/log4j.jar
 > /usr/share/tomcat6/lib/log4j.properties


...and I wonder if these instructions are why. If these instructions 
require precise applicaton then what do these instructions mean?

 >> http://tomcat.apache.org/tomcat-6.0-doc/logging.html#log4j
 >>
 >> # Download Log4J (v1.2 or later) and place the log4j jar in
 >> $CATALINA_HOME/lib.
 >> # Build or download the additional logging components. See the extras
 >> components documentation for details.
 >> # Replace $CATALINA_HOME/bin/tomcat-juli.jar with
 >> output/extras/tomcat-juli.jar.
 >> # Place output/extras/tomcat-juli-adapters.jar in $CATALINA_HOME/lib.
 >> # Delete $CATALINA_BASE/conf/logging.properties to prevent
 >> java.util.logging generating zero length log files.
 >> # Start Tomcat



Jacob Kjome said the following on 7/15/10 10:40 AM:
> Tomcat's catalina.properties contains...
> 
> common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar
> 
> This means that, assuming that "/usr/share/tomcat6" is the path set for 
> ${catalina.home}, the following should work fine...
> 
> /usr/share/tomcat6/lib/log4j.jar
> /usr/share/tomcat6/lib/log4j.properties
> 
> 
> That said, is you purpose application logging or server logging (or both)?
> 
> For application logging, this should be fine, though you'll share a 
> logger repository with all apps under Tomcat (unless you include 
> log4j.jar in WEB-INF/lib and log4j.properties or log4j.xml in 
> WEB-INF/classes ....or you use a logger repository selector).
> 
> For server logging, you need to following the instructions you already 
> referenced....
> 
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html#log4j
> 
> 
> Jake
> 
> On Thu, 15 Jul 2010 10:20:59 -0700
>  Kevin Kruzich <kkruzich@mshift.com> wrote:
>>
>> I was able to get log4j working with syslog without too much trouble
>> using tomcat5. Yet with tomcat6 I'm having a heck of a time trying to
>> figure out where log4j.properties should go.
>>
>> tomcat5:
>>
>> JAVA_OPTS="$JAVA_OPTS
>> -Dcatalina.ext.dirs=$CATALINA_HOME/shared/lib:$CATALINA_HOME/common/lib"
>>
>> /var/lib/tomcat5/common/lib/log4j.jar
>> /var/lib/tomcat5/common/classes/log4j.properties
>>
>> works great!
>>
>> ---
>>
>> tomcat6:
>>
>> tomcat    9995  0.5  1.2 649772 24900 ?        Sl   21:01   0:03
>> /usr/bin/java -classpath
>> :/usr/share/tomcat6/bin/bootstrap.jar:/usr/share/tomcat6/bin/tomcat-juli.jar:/usr/bin/build-classpath:

>> error: JVM_LIBDIR /usr/lib/jvm-exports/java-1.6.0 does not exist or is
>> not a directory -Dcatalina.base=/usr/share/tomcat6
>> -Dcatalina.home=/usr/share/tomcat6 -Djava.endorsed.dirs=
>> -Djava.io.tmpdir=/var/cache/tomcat6/temp
>> -Djava.util.logging.config.file=/usr/share/tomcat6/conf/logging.properties 
>>
>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>> org.apache.catalina.startup.Bootstrap start
>>
>>
>> /usr/share/tomcat6/lib/log4j.jar
>> /usr/share/tomcat6/lib/log4j.properties
>>
>> (and many other locations)
>>
>> fails, fails...
>>
>> *?* Do I need a dir like /usr/share/tomcat6/common
>>
>> These instructions are over 8 years old so I imagine this section, in
>> particular has changed quite a bit "Default Initialization under Tomcat"
>>
>>
>> http://logging.apache.org/log4j/1.2/manual.html
>>
>>
>> ---
>>
>> And lastly, there's this snippet on the Apache website -- is all this
>> necessary?
>>
>> http://tomcat.apache.org/tomcat-6.0-doc/logging.html#log4j
>>
>> # Download Log4J (v1.2 or later) and place the log4j jar in
>> $CATALINA_HOME/lib.
>> # Build or download the additional logging components. See the extras
>> components documentation for details.
>> # Replace $CATALINA_HOME/bin/tomcat-juli.jar with
>> output/extras/tomcat-juli.jar.
>> # Place output/extras/tomcat-juli-adapters.jar in $CATALINA_HOME/lib.
>> # Delete $CATALINA_BASE/conf/logging.properties to prevent
>> java.util.logging generating zero length log files.
>> # Start Tomcat
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

-- 

Kevin Kruzich - Network and Systems Administrator
kkruzich@mshift.com

office: 510-933-5912
mobile: 408-823-9549


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message