You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ta...@aol.com on 2001/12/12 22:25:43 UTC

need helping configuring log4j micro edition for Tomcat 4....

hello all, 

i'm new to log4j (i'm using log4j micro edition) and i've waded through the log4j manual, the FAQ, the troubleshooting page, and the archives for this list.  unfortunately, i still can't get log4j working properly. doh!  i've tried using the default initialization, ie putting the log4j.properties file in the WEB-INF/classes directory of my webapp, but to no avail.  i saw in one post that stated it was necessary to set the TOMCAT_OPTS, is that really true?  how do i set a different configuration file for each web application then?

this is the log code i put in my DbUser class:

package com.coolservlets.forum.database;
.. 
import org.apache.log4j.Category; 

public class DbUser implements User, Cacheable {
..
    // logging variable
    static Category log = 
Category.getInstance(DbUser.class.getName());

    private void loadFromDb() throws UserNotFoundException {
        ...
        log.fatal("loadFromDb(): uid=" + uid);
        log.debug("loadFromDb(): numericId=" + numericId);
        ...
     }


  here is my log4j.properties file in case there's an error in it --

log4j.rootCategory=DEBUG, R

log4j.appender.R=org.apache.log4j.FileAppender
log4j.appender.R.File=/home/httpd/websites/dev.firesofhope.org/logs/application.log

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

# Print messages with a priority of DEBUG or higher in the package com.oceangroup
log4j.category.com.coolservlets.forum.database.DbUser=DEBUG

thanks, joy

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>