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 "Dmitry S. Kravchenko" <di...@vsetech.ru> on 2006/07/05 16:35:42 UTC

FW: No appenders could be found for logger


-----Original Message-----
From: Dmitry S. Kravchenko [mailto:dims@vsetech.ru] 
Sent: Wednesday, July 05, 2006 6:04 PM
To: 'users@logging.apache.org'
Subject: No appenders could be found for logger


Hi!

I don't understand, how to use log4j in Tomcat. It seems to me, that docs
and help are not reliable. For example, Category class ang getCategory
method marked deprected in fact, but described usable in quick start guide.

I have some servlets, I have some class with the following code in
constructor

if( logger == null ) {
//      BasicConfigurator.configure();
      logger = Logger.getLogger("MetSession");
    }

(logger is static)

and the following code for logging 

logger.debug( prefix + message );

I have log4j-1.2.13.jar file in my C:\j2sdk1.4.2_10\jre\lib\ext directory,
and I have file log4j.properties in my WEB-INF/classes directory.

The content fo properties file is following

log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=/var/log/tomcat4/vtlog4j.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=[%c{1},%p] %m%n
log4j.appender.file.Append=true log4j.category.org.firebirdsql=DEBUG, file

So, it seems to me, that all is according to the manual.

But it prints warning 

log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester).
log4j:WARN Please initialize the log4j system properly.

while starting Tomcat.

What does this warning mean? What should I do to fix it?

Thanks in advance.

Dims


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


Re: FW: No appenders could be found for logger

Posted by James Stauffer <st...@gmail.com>.
Run with -Dlog4j.debug to see more info about how log4j is trying to
configure itself.

On 7/5/06, Dmitry S. Kravchenko <di...@vsetech.ru> wrote:
>
>
> -----Original Message-----
> From: Dmitry S. Kravchenko [mailto:dims@vsetech.ru]
> Sent: Wednesday, July 05, 2006 6:04 PM
> To: 'users@logging.apache.org'
> Subject: No appenders could be found for logger
>
>
> Hi!
>
> I don't understand, how to use log4j in Tomcat. It seems to me, that docs
> and help are not reliable. For example, Category class ang getCategory
> method marked deprected in fact, but described usable in quick start guide.
>
> I have some servlets, I have some class with the following code in
> constructor
>
> if( logger == null ) {
> //      BasicConfigurator.configure();
>       logger = Logger.getLogger("MetSession");
>     }
>
> (logger is static)
>
> and the following code for logging
>
> logger.debug( prefix + message );
>
> I have log4j-1.2.13.jar file in my C:\j2sdk1.4.2_10\jre\lib\ext directory,
> and I have file log4j.properties in my WEB-INF/classes directory.
>
> The content fo properties file is following
>
> log4j.appender.file=org.apache.log4j.FileAppender
> log4j.appender.file.File=/var/log/tomcat4/vtlog4j.log
> log4j.appender.file.layout=org.apache.log4j.PatternLayout
> log4j.appender.file.layout.ConversionPattern=[%c{1},%p] %m%n
> log4j.appender.file.Append=true log4j.category.org.firebirdsql=DEBUG, file
>
> So, it seems to me, that all is according to the manual.
>
> But it prints warning
>
> log4j:WARN No appenders could be found for logger
> (org.apache.commons.digester.Digester).
> log4j:WARN Please initialize the log4j system properly.
>
> while starting Tomcat.
>
> What does this warning mean? What should I do to fix it?
>
> Thanks in advance.
>
> Dims
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


Re: java.lang.NoClassDefFoundError: org/apache/log4j/Category

Posted by James Stauffer <st...@gmail.com>.
Please give the stack trace for the exception.

On 7/8/06, Dmitry S. Kravchenko <di...@vsetech.ru> wrote:
> I'm insuccessfully trying to use log4j in Tomcat webapps.
>
> Recently I tried to recognize, where I should put jar and property files to
> make system work. I found, that if I put jar file in global lib directory,
> and properties file in WEB-INF/classes directory, system does not ever start
> with the message "No appenders could be found to the logger".
>
> Then I found, that this error disappears, when I delete log4j jar from
> global directory and put it only to the directory WEB-INF/lib (what itself
> is very strange for me. why something should change because of position of
> some jar file???).
>
> So, after I put files into these directories, server able to start
> successfully.
>
> But now I can't open any page from my web application, because I have the
> following exception:
>
> java.lang.NoClassDefFoundError: org/apache/log4j/Category
>
> The absurdity of situation is that I don't use Category class, because it
> said to me, that it is obsolete!
>
> I have some servlets, I have some class with the following code in
> constructor
>
> if( logger == null ) {
>       logger = Logger.getLogger("MetSession");
>     }
>
> (logger is static)
>
> and the following code for logging
>
> logger.debug( prefix + message );
>
> Of course class Category exists in jar file.
>
> So what I can do?
>
> Thank you.
>
> Dims.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


RE: FW: No appenders could be found for logger

Posted by "Dmitry S. Kravchenko" <di...@vsetech.ru>.
This is output (log4j.properties is in
C:\var\webmet\ines_newmetsystem\WEB-INF\classes directory):

log4j: Trying to find [log4j.xml] using context classloader
StandardClassLoader
  available:
    Extension[org.apache.commons.beanutils, implementationVendor=Apache
Software Foundation, implementationVersion=1.6, specific
ationVendor=Apache Software Foundation, specificationVersion=1.6]
    Extension[org.apache.commons.digester, implementationVendor="Apache
Software Foundation", implementationVersion="1.5", speci
ficationVendor="Apache Software Foundation", specificationVersion="1.5"]
    Extension[commons-fileupload, implementationVendor=Apache Software
Foundation, implementationVendorId=, implementationVersio
n=1.0, specificationVendor=Apache Software Foundation,
specificationVersion=]
    Extension[org.apache.commons.logging, implementationVendor=Apache
Software Foundation, implementationVersion=1.0.3, specific
ationVendor=Apache Software Foundation, specificationVersion=1.0]
    Extension[org.apache.commons.modeler, implementationVendor=Apache
Software Foundation, implementationVendorId=org.apache, im
plementationVersion=1.1.0, specificationVendor=Apache Software Foundation,
specificationVersion=1.1]
    Extension[coyote, implementationVendor=Apache Software Foundation,
implementationVersion=1.0-dev, specificationVendor=Apache
 Software Foundation, specificationVersion=1.0]
    Extension[@name@, implementationVendor=Apache Software Foundation,
implementationVersion=@version@, specificationVendor=Apac
he Software Foundation, specificationVersion=1.0]
    Extension[org.apache.jk, implementationVendor=Apache Software
Foundation, implementationVendorId=org.apache, implementationV
ersion=2.1, specificationVendor=Apache Software Foundation,
specificationVersion=2.0]
    Extension[org.apache.tomcat.util, implementationVendor=Apache Software
Foundation, implementationVendorId=org.apache, implem
entationVersion=5.1, specificationVendor=Apache Software Foundation,
specificationVersion=3.0]
  delegate: true
  repositories:
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\classes\
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\catalina-ant.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\catalina.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-beanutils.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-digester.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-fileupload-1.0.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-logging.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-modeler.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\jaas.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\jakarta-regexp-1.3.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\mx4j-jmx.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-common.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-default.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-invoker.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-manager.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-webdav.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\tomcat-coyote.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\tomcat-http11.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\tomcat-jk.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\tomcat-jk2.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\tomcat-util.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\tomcat-warp.jar
  required:
----------> Parent Classloader:
StandardClassLoader
  available:
    Extension[org.apache.tools.ant, implementationVendor=Apache Software
Foundation, implementationVersion=1.5.4, specificationV
endor=Apache Software Foundation, specificationVersion=1.5.4]
    Extension[org.apache.commons.collections, implementationVendor=Apache
Software Foundation, implementationVersion=2.1, specif
icationVendor=Apache Software Foundation, specificationVersion=2.1]
    Extension[commons-dbcp, implementationVendor=Apache Software Foundation,
implementationVendorId=, implementationVersion=1.1,
 specificationVendor=Apache Software Foundation, specificationVersion=]
    Extension[org.apache.commons.logging, implementationVendor=Apache
Software Foundation, implementationVersion=1.0.3, specific
ationVendor=Apache Software Foundation, specificationVersion=1.0]
    Extension[commons-pool, implementationVendor=Apache Software Foundation,
implementationVendorId=, implementationVersion=1.1,
 specificationVendor=Apache Software Foundation, specificationVersion=]
    Extension[javax.mail, implementationVendor=Sun Microsystems, Inc.,
implementationVendorId=com.sun, implementationVersion=1.2
, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.2]
  delegate: true
  repositories:
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\classes\
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\endorsed\xercesImpl.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\endorsed\xmlParserAPIs.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\activation.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\ant.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\commons-collections.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\commons-dbcp-1.1.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\commons-logging-api.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\commons-pool-1.1.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\jasper-compiler.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\jasper-runtime.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\jdbc2_0-stdext.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\jndi.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\jta.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\mail.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\naming-common.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\naming-factory.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\naming-resources.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\tools.jar
  required:
----------> Parent Classloader:
sun.misc.Launcher$AppClassLoader@bfbdb0

.
log4j: Trying to find [log4j.xml] using
sun.misc.Launcher$ExtClassLoader@3e86d0 class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader
StandardClassLoader
  available:
    Extension[org.apache.commons.beanutils, implementationVendor=Apache
Software Foundation, implementationVersion=1.6, specific
ationVendor=Apache Software Foundation, specificationVersion=1.6]
    Extension[org.apache.commons.digester, implementationVendor="Apache
Software Foundation", implementationVersion="1.5", speci
ficationVendor="Apache Software Foundation", specificationVersion="1.5"]
    Extension[commons-fileupload, implementationVendor=Apache Software
Foundation, implementationVendorId=, implementationVersio
n=1.0, specificationVendor=Apache Software Foundation,
specificationVersion=]
    Extension[org.apache.commons.logging, implementationVendor=Apache
Software Foundation, implementationVersion=1.0.3, specific
ationVendor=Apache Software Foundation, specificationVersion=1.0]
    Extension[org.apache.commons.modeler, implementationVendor=Apache
Software Foundation, implementationVendorId=org.apache, im
plementationVersion=1.1.0, specificationVendor=Apache Software Foundation,
specificationVersion=1.1]
    Extension[coyote, implementationVendor=Apache Software Foundation,
implementationVersion=1.0-dev, specificationVendor=Apache
 Software Foundation, specificationVersion=1.0]
    Extension[@name@, implementationVendor=Apache Software Foundation,
implementationVersion=@version@, specificationVendor=Apac
he Software Foundation, specificationVersion=1.0]
    Extension[org.apache.jk, implementationVendor=Apache Software
Foundation, implementationVendorId=org.apache, implementationV
ersion=2.1, specificationVendor=Apache Software Foundation,
specificationVersion=2.0]
    Extension[org.apache.tomcat.util, implementationVendor=Apache Software
Foundation, implementationVendorId=org.apache, implem
entationVersion=5.1, specificationVendor=Apache Software Foundation,
specificationVersion=3.0]
  delegate: true
  repositories:
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\classes\
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\catalina-ant.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\catalina.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-beanutils.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-digester.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-fileupload-1.0.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-logging.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\commons-modeler.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\jaas.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\jakarta-regexp-1.3.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\mx4j-jmx.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-common.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-default.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-invoker.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-manager.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\servlets-webdav.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\tomcat-coyote.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\server\lib\tomcat-http11.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\tomcat-jk.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\tomcat-jk2.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\tomcat-util.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\server\lib\tomcat-warp.jar
  required:
----------> Parent Classloader:
StandardClassLoader
  available:
    Extension[org.apache.tools.ant, implementationVendor=Apache Software
Foundation, implementationVersion=1.5.4, specificationV
endor=Apache Software Foundation, specificationVersion=1.5.4]
    Extension[org.apache.commons.collections, implementationVendor=Apache
Software Foundation, implementationVersion=2.1, specif
icationVendor=Apache Software Foundation, specificationVersion=2.1]
    Extension[commons-dbcp, implementationVendor=Apache Software Foundation,
implementationVendorId=, implementationVersion=1.1,
 specificationVendor=Apache Software Foundation, specificationVersion=]
    Extension[org.apache.commons.logging, implementationVendor=Apache
Software Foundation, implementationVersion=1.0.3, specific
ationVendor=Apache Software Foundation, specificationVersion=1.0]
    Extension[commons-pool, implementationVendor=Apache Software Foundation,
implementationVendorId=, implementationVersion=1.1,
 specificationVendor=Apache Software Foundation, specificationVersion=]
    Extension[javax.mail, implementationVendor=Sun Microsystems, Inc.,
implementationVendorId=com.sun, implementationVersion=1.2
, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.2]
  delegate: true
  repositories:
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\classes\
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\endorsed\xercesImpl.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\endorsed\xmlParserAPIs.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\activation.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\ant.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\commons-collections.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\commons-dbcp-1.1.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\commons-logging-api.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\commons-pool-1.1.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\jasper-compiler.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\jasper-runtime.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\jdbc2_0-stdext.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\jndi.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\jta.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\mail.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\naming-common.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\naming-factory.jar
    file:C:\Program Files\Apache Group\Tomcat
4.1\common\lib\naming-resources.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar
    file:C:\Program Files\Apache Group\Tomcat 4.1\common\lib\tools.jar
  required:
----------> Parent Classloader:
sun.misc.Launcher$AppClassLoader@bfbdb0

.
log4j: Trying to find [log4j.properties] using
sun.misc.Launcher$ExtClassLoader@3e86d0 class loader.
log4j: Trying to find [log4j.properties] using
ClassLoader.getSystemResource().
log4j: Could not find resource: [null].
log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester).
log4j:WARN Please initialize the log4j system properly.
Starting service Tomcat-Standalone
Apache Tomcat/4.1.29

> -----Original Message-----
> From: James Stauffer [mailto:stauffer.james@gmail.com] 
> Sent: Wednesday, July 05, 2006 9:05 PM
> To: Log4J Users List
> Subject: Re: FW: No appenders could be found for logger
> 
> 
> Look at http://wiki.apache.org/logging-log4j/Log4jConfigurationHelp
> If you still have questions please send the output that 
> log4j.debug caused.
> 
> On 7/5/06, Dmitry S. Kravchenko <di...@vsetech.ru> wrote:
> > > If you want a separate config for each app, you need to put 
> > > log4j.jar in WEB-INF/lib and log4j.properties in WEB-INF/classes
> >
> > So, this is what I have done. But it does not work.
> >
> > >
> > > On 7/5/06, Dmitry S. Kravchenko <di...@vsetech.ru> wrote:
> > > > Thank you.
> > > >
> > > > I'v already found this solution, but it seems to me, that it is 
> > > > not completely applicable for me. I want to have separate
> > > properties for
> > > > each web-application. Is it correct? Or I should have 
> one global 
> > > > properties file for my server? In each case, I do not control 
> > > > classpath. Tomcat starts with the script. Several places,
> > > in which I
> > > > tried to place properties file, had no effect. Is there one 
> > > > convetional place to put properties file in the case of Tomcat 
> > > > webapps? Is there conventional way to patch Tomcat script 
> > > > configuration in order it to search this place?
> > > >
> > > > Dims.
> > > >
> > > > > -----Original Message-----
> > > > > From: jaikiran pai [mailto:jai_forums2005@yahoo.co.in]
> > > > > Sent: Wednesday, July 05, 2006 6:42 PM
> > > > > To: Log4J Users List
> > > > > Subject: Re: FW: No appenders could be found for logger
> > > > >
> > > > >
> > > > > The WARN message that you are seeing, indicates that the 
> > > > > log4j.properties file is NOT in your classpath. Place 
> the file 
> > > > > in your classpath.  Some days back there was a similar
> > > question where
> > > > > the user reported that he was seeing the same WARN
> > > message. Here's
> > > > > an extract from that thread:
> > > > >
> > > > >   -------------------------------------
> > > > >   -----Original Message-----
> > > > >   From: James Stauffer [mailto:stauffer.james@gmail.com]
> > > > >   Sent: Thursday, June 29, 2006 8:20 PM
> > > > >   To: Log4J Users List
> > > > >   Subject: Re: Ant Log4J not working
> > > > >
> > > > >   If you added -Dlog4j.debug to the command line log4j
> > > will output
> > > > > info
> > > > >   to std. out. telling you how it tries to configure itself.
> > > > >   On 6/29/06, jaikiran pai <ja...@yahoo.co.in> wrote:
> > > > >   > Rohit,
> > > > >   > This means that the log4j.properties file that you
> > > have created
> > > > > in NOT in the classpath. Make it available in the classpath.
> > > > >   >
> > > > >   > regards,
> > > > >   > -Jaikiran
> > > > >   >
> > > > >   > Rohit B Rai <br...@cordys.com> wrote:
> > > > >   > I am trying to use Log4J for logging from Ant but it
> > > gives these
> > > > > errors.
> > > > >   >
> > > > >   >
> > > > >   >
> > > > >   > log4j:WARN No appenders could be found for logger
> > > > >   > (org.apache.tools.ant).
> > > > >   >
> > > > >   > log4j:WARN Please initialize the log4j system properly.
> > > > >
> > > > >   ------------
> > > > >
> > > > >   regards,
> > > > >   -Jaikiran
> > > > >
> > > > > "Dmitry S. Kravchenko" <di...@vsetech.ru> wrote:
> > > > >
> > > > >
> > > > > -----Original Message-----
> > > > > From: Dmitry S. Kravchenko [mailto:dims@vsetech.ru]
> > > > > Sent: Wednesday, July 05, 2006 6:04 PM
> > > > > To: 'users@logging.apache.org'
> > > > > Subject: No appenders could be found for logger
> > > > >
> > > > >
> > > > > Hi!
> > > > >
> > > > > I don't understand, how to use log4j in Tomcat. It seems
> > > to me, that
> > > > > docs and help are not reliable. For example, Category 
> class ang 
> > > > > getCategory method marked deprected in fact, but
> > > described usable in
> > > > > quick start guide.
> > > > >
> > > > > I have some servlets, I have some class with the
> > > following code in
> > > > > constructor
> > > > >
> > > > > if( logger == null ) {
> > > > > // BasicConfigurator.configure();
> > > > > logger = Logger.getLogger("MetSession");
> > > > > }
> > > > >
> > > > > (logger is static)
> > > > >
> > > > > and the following code for logging
> > > > >
> > > > > logger.debug( prefix + message );
> > > > >
> > > > > I have log4j-1.2.13.jar file in my 
> C:\j2sdk1.4.2_10\jre\lib\ext 
> > > > > directory, and I have file log4j.properties in my 
> > > > > WEB-INF/classes directory.
> > > > >
> > > > > The content fo properties file is following
> > > > >
> > > > > log4j.appender.file=org.apache.log4j.FileAppender
> > > > > log4j.appender.file.File=/var/log/tomcat4/vtlog4j.log
> > > > > log4j.appender.file.layout=org.apache.log4j.PatternLayout
> > > > > log4j.appender.file.layout.ConversionPattern=[%c{1},%p] %m%n 
> > > > > log4j.appender.file.Append=true 
> > > > > log4j.category.org.firebirdsql=DEBUG, file
> > > > >
> > > > > So, it seems to me, that all is according to the manual.
> > > > >
> > > > > But it prints warning
> > > > >
> > > > > log4j:WARN No appenders could be found for logger 
> > > > > (org.apache.commons.digester.Digester).
> > > > > log4j:WARN Please initialize the log4j system properly.
> > > > >
> > > > > while starting Tomcat.
> > > > >
> > > > > What does this warning mean? What should I do to fix it?
> > > > >
> > > > > Thanks in advance.
> > > > >
> > > > > Dims
> > > > >
> > > > >
> > > > >
> > > 
> --------------------------------------------------------------------
> > > > > -
> > > > > To unsubscribe, e-mail: 
> > > > > log4j-user-unsubscribe@logging.apache.org
> > > > > For additional commands, e-mail:
> > > log4j-user-help@logging.apache.org
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > ---------------------------------
> > > > >  Yahoo! India Answers: Share what you know. Learn 
> something new 
> > > > > Click here Catch all the FIFA World Cup 2006 action on
> > > Yahoo! India
> > > > > Click here
> > > > >
> > > >
> > > >
> > > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > > To unsubscribe, e-mail: 
> log4j-user-unsubscribe@logging.apache.org
> > > > For additional commands, e-mail: 
> > > > log4j-user-help@logging.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > James Stauffer
> > > Are you good? Take the test at http://www.livingwaters.com/good/
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > 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
> >
> >
> 
> 
> -- 
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
> 
> ---------------------------------------------------------------------
> 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


java.lang.NoClassDefFoundError: org/apache/log4j/Category

Posted by "Dmitry S. Kravchenko" <di...@vsetech.ru>.
I'm insuccessfully trying to use log4j in Tomcat webapps.

Recently I tried to recognize, where I should put jar and property files to
make system work. I found, that if I put jar file in global lib directory,
and properties file in WEB-INF/classes directory, system does not ever start
with the message "No appenders could be found to the logger".

Then I found, that this error disappears, when I delete log4j jar from
global directory and put it only to the directory WEB-INF/lib (what itself
is very strange for me. why something should change because of position of
some jar file???).

So, after I put files into these directories, server able to start
successfully.

But now I can't open any page from my web application, because I have the
following exception:

java.lang.NoClassDefFoundError: org/apache/log4j/Category

The absurdity of situation is that I don't use Category class, because it
said to me, that it is obsolete! 

I have some servlets, I have some class with the following code in
constructor

if( logger == null ) {
      logger = Logger.getLogger("MetSession");
    }

(logger is static)

and the following code for logging 

logger.debug( prefix + message );

Of course class Category exists in jar file. 

So what I can do?

Thank you.

Dims.


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


Re: FW: No appenders could be found for logger

Posted by James Stauffer <st...@gmail.com>.
Look at http://wiki.apache.org/logging-log4j/Log4jConfigurationHelp
If you still have questions please send the output that log4j.debug
caused.

On 7/5/06, Dmitry S. Kravchenko <di...@vsetech.ru> wrote:
> > If you want a separate config for each app, you need to put
> > log4j.jar in WEB-INF/lib and log4j.properties in WEB-INF/classes
>
> So, this is what I have done. But it does not work.
>
> >
> > On 7/5/06, Dmitry S. Kravchenko <di...@vsetech.ru> wrote:
> > > Thank you.
> > >
> > > I'v already found this solution, but it seems to me, that it is not
> > > completely applicable for me. I want to have separate
> > properties for
> > > each web-application. Is it correct? Or I should have one global
> > > properties file for my server? In each case, I do not control
> > > classpath. Tomcat starts with the script. Several places,
> > in which I
> > > tried to place properties file, had no effect. Is there one
> > > convetional place to put properties file in the case of Tomcat
> > > webapps? Is there conventional way to patch Tomcat script
> > > configuration in order it to search this place?
> > >
> > > Dims.
> > >
> > > > -----Original Message-----
> > > > From: jaikiran pai [mailto:jai_forums2005@yahoo.co.in]
> > > > Sent: Wednesday, July 05, 2006 6:42 PM
> > > > To: Log4J Users List
> > > > Subject: Re: FW: No appenders could be found for logger
> > > >
> > > >
> > > > The WARN message that you are seeing, indicates that the
> > > > log4j.properties file is NOT in your classpath. Place the file in
> > > > your classpath.  Some days back there was a similar
> > question where
> > > > the user reported that he was seeing the same WARN
> > message. Here's
> > > > an extract from that thread:
> > > >
> > > >   -------------------------------------
> > > >   -----Original Message-----
> > > >   From: James Stauffer [mailto:stauffer.james@gmail.com]
> > > >   Sent: Thursday, June 29, 2006 8:20 PM
> > > >   To: Log4J Users List
> > > >   Subject: Re: Ant Log4J not working
> > > >
> > > >   If you added -Dlog4j.debug to the command line log4j
> > will output
> > > > info
> > > >   to std. out. telling you how it tries to configure itself.
> > > >   On 6/29/06, jaikiran pai <ja...@yahoo.co.in> wrote:
> > > >   > Rohit,
> > > >   > This means that the log4j.properties file that you
> > have created
> > > > in NOT in the classpath. Make it available in the classpath.
> > > >   >
> > > >   > regards,
> > > >   > -Jaikiran
> > > >   >
> > > >   > Rohit B Rai <br...@cordys.com> wrote:
> > > >   > I am trying to use Log4J for logging from Ant but it
> > gives these
> > > > errors.
> > > >   >
> > > >   >
> > > >   >
> > > >   > log4j:WARN No appenders could be found for logger
> > > >   > (org.apache.tools.ant).
> > > >   >
> > > >   > log4j:WARN Please initialize the log4j system properly.
> > > >
> > > >   ------------
> > > >
> > > >   regards,
> > > >   -Jaikiran
> > > >
> > > > "Dmitry S. Kravchenko" <di...@vsetech.ru> wrote:
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Dmitry S. Kravchenko [mailto:dims@vsetech.ru]
> > > > Sent: Wednesday, July 05, 2006 6:04 PM
> > > > To: 'users@logging.apache.org'
> > > > Subject: No appenders could be found for logger
> > > >
> > > >
> > > > Hi!
> > > >
> > > > I don't understand, how to use log4j in Tomcat. It seems
> > to me, that
> > > > docs and help are not reliable. For example, Category class ang
> > > > getCategory method marked deprected in fact, but
> > described usable in
> > > > quick start guide.
> > > >
> > > > I have some servlets, I have some class with the
> > following code in
> > > > constructor
> > > >
> > > > if( logger == null ) {
> > > > // BasicConfigurator.configure();
> > > > logger = Logger.getLogger("MetSession");
> > > > }
> > > >
> > > > (logger is static)
> > > >
> > > > and the following code for logging
> > > >
> > > > logger.debug( prefix + message );
> > > >
> > > > I have log4j-1.2.13.jar file in my C:\j2sdk1.4.2_10\jre\lib\ext
> > > > directory, and I have file log4j.properties in my WEB-INF/classes
> > > > directory.
> > > >
> > > > The content fo properties file is following
> > > >
> > > > log4j.appender.file=org.apache.log4j.FileAppender
> > > > log4j.appender.file.File=/var/log/tomcat4/vtlog4j.log
> > > > log4j.appender.file.layout=org.apache.log4j.PatternLayout
> > > > log4j.appender.file.layout.ConversionPattern=[%c{1},%p] %m%n
> > > > log4j.appender.file.Append=true
> > > > log4j.category.org.firebirdsql=DEBUG, file
> > > >
> > > > So, it seems to me, that all is according to the manual.
> > > >
> > > > But it prints warning
> > > >
> > > > log4j:WARN No appenders could be found for logger
> > > > (org.apache.commons.digester.Digester).
> > > > log4j:WARN Please initialize the log4j system properly.
> > > >
> > > > while starting Tomcat.
> > > >
> > > > What does this warning mean? What should I do to fix it?
> > > >
> > > > Thanks in advance.
> > > >
> > > > Dims
> > > >
> > > >
> > > >
> > --------------------------------------------------------------------
> > > > -
> > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > For additional commands, e-mail:
> > log4j-user-help@logging.apache.org
> > > >
> > > >
> > > >
> > > >
> > > > ---------------------------------
> > > >  Yahoo! India Answers: Share what you know. Learn something new
> > > > Click here Catch all the FIFA World Cup 2006 action on
> > Yahoo! India
> > > > Click here
> > > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
> >
> > --
> > James Stauffer
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > 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
>
>


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


RE: FW: No appenders could be found for logger

Posted by "Dmitry S. Kravchenko" <di...@vsetech.ru>.
> If you want a separate config for each app, you need to put 
> log4j.jar in WEB-INF/lib and log4j.properties in WEB-INF/classes

So, this is what I have done. But it does not work.

> 
> On 7/5/06, Dmitry S. Kravchenko <di...@vsetech.ru> wrote:
> > Thank you.
> >
> > I'v already found this solution, but it seems to me, that it is not 
> > completely applicable for me. I want to have separate 
> properties for 
> > each web-application. Is it correct? Or I should have one global 
> > properties file for my server? In each case, I do not control 
> > classpath. Tomcat starts with the script. Several places, 
> in which I 
> > tried to place properties file, had no effect. Is there one 
> > convetional place to put properties file in the case of Tomcat 
> > webapps? Is there conventional way to patch Tomcat script 
> > configuration in order it to search this place?
> >
> > Dims.
> >
> > > -----Original Message-----
> > > From: jaikiran pai [mailto:jai_forums2005@yahoo.co.in]
> > > Sent: Wednesday, July 05, 2006 6:42 PM
> > > To: Log4J Users List
> > > Subject: Re: FW: No appenders could be found for logger
> > >
> > >
> > > The WARN message that you are seeing, indicates that the 
> > > log4j.properties file is NOT in your classpath. Place the file in 
> > > your classpath.  Some days back there was a similar 
> question where 
> > > the user reported that he was seeing the same WARN 
> message. Here's 
> > > an extract from that thread:
> > >
> > >   -------------------------------------
> > >   -----Original Message-----
> > >   From: James Stauffer [mailto:stauffer.james@gmail.com]
> > >   Sent: Thursday, June 29, 2006 8:20 PM
> > >   To: Log4J Users List
> > >   Subject: Re: Ant Log4J not working
> > >
> > >   If you added -Dlog4j.debug to the command line log4j 
> will output 
> > > info
> > >   to std. out. telling you how it tries to configure itself.
> > >   On 6/29/06, jaikiran pai <ja...@yahoo.co.in> wrote:
> > >   > Rohit,
> > >   > This means that the log4j.properties file that you 
> have created 
> > > in NOT in the classpath. Make it available in the classpath.
> > >   >
> > >   > regards,
> > >   > -Jaikiran
> > >   >
> > >   > Rohit B Rai <br...@cordys.com> wrote:
> > >   > I am trying to use Log4J for logging from Ant but it 
> gives these 
> > > errors.
> > >   >
> > >   >
> > >   >
> > >   > log4j:WARN No appenders could be found for logger
> > >   > (org.apache.tools.ant).
> > >   >
> > >   > log4j:WARN Please initialize the log4j system properly.
> > >
> > >   ------------
> > >
> > >   regards,
> > >   -Jaikiran
> > >
> > > "Dmitry S. Kravchenko" <di...@vsetech.ru> wrote:
> > >
> > >
> > > -----Original Message-----
> > > From: Dmitry S. Kravchenko [mailto:dims@vsetech.ru]
> > > Sent: Wednesday, July 05, 2006 6:04 PM
> > > To: 'users@logging.apache.org'
> > > Subject: No appenders could be found for logger
> > >
> > >
> > > Hi!
> > >
> > > I don't understand, how to use log4j in Tomcat. It seems 
> to me, that 
> > > docs and help are not reliable. For example, Category class ang 
> > > getCategory method marked deprected in fact, but 
> described usable in 
> > > quick start guide.
> > >
> > > I have some servlets, I have some class with the 
> following code in 
> > > constructor
> > >
> > > if( logger == null ) {
> > > // BasicConfigurator.configure();
> > > logger = Logger.getLogger("MetSession");
> > > }
> > >
> > > (logger is static)
> > >
> > > and the following code for logging
> > >
> > > logger.debug( prefix + message );
> > >
> > > I have log4j-1.2.13.jar file in my C:\j2sdk1.4.2_10\jre\lib\ext 
> > > directory, and I have file log4j.properties in my WEB-INF/classes 
> > > directory.
> > >
> > > The content fo properties file is following
> > >
> > > log4j.appender.file=org.apache.log4j.FileAppender
> > > log4j.appender.file.File=/var/log/tomcat4/vtlog4j.log
> > > log4j.appender.file.layout=org.apache.log4j.PatternLayout
> > > log4j.appender.file.layout.ConversionPattern=[%c{1},%p] %m%n 
> > > log4j.appender.file.Append=true 
> > > log4j.category.org.firebirdsql=DEBUG, file
> > >
> > > So, it seems to me, that all is according to the manual.
> > >
> > > But it prints warning
> > >
> > > log4j:WARN No appenders could be found for logger 
> > > (org.apache.commons.digester.Digester).
> > > log4j:WARN Please initialize the log4j system properly.
> > >
> > > while starting Tomcat.
> > >
> > > What does this warning mean? What should I do to fix it?
> > >
> > > Thanks in advance.
> > >
> > > Dims
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: 
> log4j-user-help@logging.apache.org
> > >
> > >
> > >
> > >
> > > ---------------------------------
> > >  Yahoo! India Answers: Share what you know. Learn something new 
> > > Click here Catch all the FIFA World Cup 2006 action on 
> Yahoo! India 
> > > Click here
> > >
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> 
> 
> -- 
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
> 
> ---------------------------------------------------------------------
> 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


Re: FW: No appenders could be found for logger

Posted by James Stauffer <st...@gmail.com>.
If you want a separate config for each app, you need to put log4j.jar
in WEB-INF/lib and log4j.properties in WEB-INF/classes

On 7/5/06, Dmitry S. Kravchenko <di...@vsetech.ru> wrote:
> Thank you.
>
> I'v already found this solution, but it seems to me, that it is not
> completely applicable for me. I want to have separate properties for each
> web-application. Is it correct? Or I should have one global properties file
> for my server? In each case, I do not control classpath. Tomcat starts with
> the script. Several places, in which I tried to place properties file, had
> no effect. Is there one convetional place to put properties file in the case
> of Tomcat webapps? Is there conventional way to patch Tomcat script
> configuration in order it to search this place?
>
> Dims.
>
> > -----Original Message-----
> > From: jaikiran pai [mailto:jai_forums2005@yahoo.co.in]
> > Sent: Wednesday, July 05, 2006 6:42 PM
> > To: Log4J Users List
> > Subject: Re: FW: No appenders could be found for logger
> >
> >
> > The WARN message that you are seeing, indicates that the
> > log4j.properties file is NOT in your classpath. Place the
> > file in your classpath.  Some days back there was a similar
> > question where the user reported that he was seeing the same
> > WARN message. Here's an extract from that thread:
> >
> >   -------------------------------------
> >   -----Original Message-----
> >   From: James Stauffer [mailto:stauffer.james@gmail.com]
> >   Sent: Thursday, June 29, 2006 8:20 PM
> >   To: Log4J Users List
> >   Subject: Re: Ant Log4J not working
> >
> >   If you added -Dlog4j.debug to the command line log4j will
> > output info
> >   to std. out. telling you how it tries to configure itself.
> >   On 6/29/06, jaikiran pai <ja...@yahoo.co.in> wrote:
> >   > Rohit,
> >   > This means that the log4j.properties file that you have
> > created in NOT in the classpath. Make it available in the classpath.
> >   >
> >   > regards,
> >   > -Jaikiran
> >   >
> >   > Rohit B Rai <br...@cordys.com> wrote:
> >   > I am trying to use Log4J for logging from Ant but it
> > gives these errors.
> >   >
> >   >
> >   >
> >   > log4j:WARN No appenders could be found for logger
> >   > (org.apache.tools.ant).
> >   >
> >   > log4j:WARN Please initialize the log4j system properly.
> >
> >   ------------
> >
> >   regards,
> >   -Jaikiran
> >
> > "Dmitry S. Kravchenko" <di...@vsetech.ru> wrote:
> >
> >
> > -----Original Message-----
> > From: Dmitry S. Kravchenko [mailto:dims@vsetech.ru]
> > Sent: Wednesday, July 05, 2006 6:04 PM
> > To: 'users@logging.apache.org'
> > Subject: No appenders could be found for logger
> >
> >
> > Hi!
> >
> > I don't understand, how to use log4j in Tomcat. It seems to
> > me, that docs and help are not reliable. For example,
> > Category class ang getCategory method marked deprected in
> > fact, but described usable in quick start guide.
> >
> > I have some servlets, I have some class with the following
> > code in constructor
> >
> > if( logger == null ) {
> > // BasicConfigurator.configure();
> > logger = Logger.getLogger("MetSession");
> > }
> >
> > (logger is static)
> >
> > and the following code for logging
> >
> > logger.debug( prefix + message );
> >
> > I have log4j-1.2.13.jar file in my
> > C:\j2sdk1.4.2_10\jre\lib\ext directory, and I have file
> > log4j.properties in my WEB-INF/classes directory.
> >
> > The content fo properties file is following
> >
> > log4j.appender.file=org.apache.log4j.FileAppender
> > log4j.appender.file.File=/var/log/tomcat4/vtlog4j.log
> > log4j.appender.file.layout=org.apache.log4j.PatternLayout
> > log4j.appender.file.layout.ConversionPattern=[%c{1},%p] %m%n
> > log4j.appender.file.Append=true
> > log4j.category.org.firebirdsql=DEBUG, file
> >
> > So, it seems to me, that all is according to the manual.
> >
> > But it prints warning
> >
> > log4j:WARN No appenders could be found for logger
> > (org.apache.commons.digester.Digester).
> > log4j:WARN Please initialize the log4j system properly.
> >
> > while starting Tomcat.
> >
> > What does this warning mean? What should I do to fix it?
> >
> > Thanks in advance.
> >
> > Dims
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> >
> >
> > ---------------------------------
> >  Yahoo! India Answers: Share what you know. Learn something
> > new Click here Catch all the FIFA World Cup 2006 action on
> > Yahoo! India Click here
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


RE: FW: No appenders could be found for logger

Posted by "Dmitry S. Kravchenko" <di...@vsetech.ru>.
Thank you.

I'v already found this solution, but it seems to me, that it is not
completely applicable for me. I want to have separate properties for each
web-application. Is it correct? Or I should have one global properties file
for my server? In each case, I do not control classpath. Tomcat starts with
the script. Several places, in which I tried to place properties file, had
no effect. Is there one convetional place to put properties file in the case
of Tomcat webapps? Is there conventional way to patch Tomcat script
configuration in order it to search this place?

Dims.

> -----Original Message-----
> From: jaikiran pai [mailto:jai_forums2005@yahoo.co.in] 
> Sent: Wednesday, July 05, 2006 6:42 PM
> To: Log4J Users List
> Subject: Re: FW: No appenders could be found for logger
> 
> 
> The WARN message that you are seeing, indicates that the 
> log4j.properties file is NOT in your classpath. Place the 
> file in your classpath.  Some days back there was a similar 
> question where the user reported that he was seeing the same 
> WARN message. Here's an extract from that thread:
>    
>   -------------------------------------
>   -----Original Message-----
>   From: James Stauffer [mailto:stauffer.james@gmail.com]
>   Sent: Thursday, June 29, 2006 8:20 PM
>   To: Log4J Users List
>   Subject: Re: Ant Log4J not working
>    
>   If you added -Dlog4j.debug to the command line log4j will 
> output info
>   to std. out. telling you how it tries to configure itself.
>   On 6/29/06, jaikiran pai <ja...@yahoo.co.in> wrote:
>   > Rohit,
>   > This means that the log4j.properties file that you have 
> created in NOT in the classpath. Make it available in the classpath.
>   >
>   > regards,
>   > -Jaikiran
>   >
>   > Rohit B Rai <br...@cordys.com> wrote:
>   > I am trying to use Log4J for logging from Ant but it 
> gives these errors.
>   >
>   >
>   >
>   > log4j:WARN No appenders could be found for logger
>   > (org.apache.tools.ant).
>   >
>   > log4j:WARN Please initialize the log4j system properly.
>    
>   ------------
>    
>   regards,
>   -Jaikiran
> 
> "Dmitry S. Kravchenko" <di...@vsetech.ru> wrote:
>   
> 
> -----Original Message-----
> From: Dmitry S. Kravchenko [mailto:dims@vsetech.ru] 
> Sent: Wednesday, July 05, 2006 6:04 PM
> To: 'users@logging.apache.org'
> Subject: No appenders could be found for logger
> 
> 
> Hi!
> 
> I don't understand, how to use log4j in Tomcat. It seems to 
> me, that docs and help are not reliable. For example, 
> Category class ang getCategory method marked deprected in 
> fact, but described usable in quick start guide.
> 
> I have some servlets, I have some class with the following 
> code in constructor
> 
> if( logger == null ) {
> // BasicConfigurator.configure();
> logger = Logger.getLogger("MetSession");
> }
> 
> (logger is static)
> 
> and the following code for logging 
> 
> logger.debug( prefix + message );
> 
> I have log4j-1.2.13.jar file in my 
> C:\j2sdk1.4.2_10\jre\lib\ext directory, and I have file 
> log4j.properties in my WEB-INF/classes directory.
> 
> The content fo properties file is following
> 
> log4j.appender.file=org.apache.log4j.FileAppender
> log4j.appender.file.File=/var/log/tomcat4/vtlog4j.log
> log4j.appender.file.layout=org.apache.log4j.PatternLayout
> log4j.appender.file.layout.ConversionPattern=[%c{1},%p] %m%n 
> log4j.appender.file.Append=true 
> log4j.category.org.firebirdsql=DEBUG, file
> 
> So, it seems to me, that all is according to the manual.
> 
> But it prints warning 
> 
> log4j:WARN No appenders could be found for logger 
> (org.apache.commons.digester.Digester).
> log4j:WARN Please initialize the log4j system properly.
> 
> while starting Tomcat.
> 
> What does this warning mean? What should I do to fix it?
> 
> Thanks in advance.
> 
> Dims
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> 
>  				
> ---------------------------------
>  Yahoo! India Answers: Share what you know. Learn something 
> new Click here Catch all the FIFA World Cup 2006 action on 
> Yahoo! India Click here
> 


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


Re: FW: No appenders could be found for logger

Posted by jaikiran pai <ja...@yahoo.co.in>.
The WARN message that you are seeing, indicates that the log4j.properties file is NOT in your classpath. Place the file in your classpath.  Some days back there was a similar question where the user reported that he was seeing the same WARN message. Here's an extract from that thread:
   
  -------------------------------------
  -----Original Message-----
  From: James Stauffer [mailto:stauffer.james@gmail.com]
  Sent: Thursday, June 29, 2006 8:20 PM
  To: Log4J Users List
  Subject: Re: Ant Log4J not working
   
  If you added -Dlog4j.debug to the command line log4j will output info
  to std. out. telling you how it tries to configure itself.
  On 6/29/06, jaikiran pai <ja...@yahoo.co.in> wrote:
  > Rohit,
  > This means that the log4j.properties file that you have created in NOT in the classpath. Make it available in the classpath.
  >
  > regards,
  > -Jaikiran
  >
  > Rohit B Rai <br...@cordys.com> wrote:
  > I am trying to use Log4J for logging from Ant but it gives these errors.
  >
  >
  >
  > log4j:WARN No appenders could be found for logger
  > (org.apache.tools.ant).
  >
  > log4j:WARN Please initialize the log4j system properly.
   
  ------------
   
  regards,
  -Jaikiran

"Dmitry S. Kravchenko" <di...@vsetech.ru> wrote:
  

-----Original Message-----
From: Dmitry S. Kravchenko [mailto:dims@vsetech.ru] 
Sent: Wednesday, July 05, 2006 6:04 PM
To: 'users@logging.apache.org'
Subject: No appenders could be found for logger


Hi!

I don't understand, how to use log4j in Tomcat. It seems to me, that docs
and help are not reliable. For example, Category class ang getCategory
method marked deprected in fact, but described usable in quick start guide.

I have some servlets, I have some class with the following code in
constructor

if( logger == null ) {
// BasicConfigurator.configure();
logger = Logger.getLogger("MetSession");
}

(logger is static)

and the following code for logging 

logger.debug( prefix + message );

I have log4j-1.2.13.jar file in my C:\j2sdk1.4.2_10\jre\lib\ext directory,
and I have file log4j.properties in my WEB-INF/classes directory.

The content fo properties file is following

log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=/var/log/tomcat4/vtlog4j.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=[%c{1},%p] %m%n
log4j.appender.file.Append=true log4j.category.org.firebirdsql=DEBUG, file

So, it seems to me, that all is according to the manual.

But it prints warning 

log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester).
log4j:WARN Please initialize the log4j system properly.

while starting Tomcat.

What does this warning mean? What should I do to fix it?

Thanks in advance.

Dims


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



 				
---------------------------------
 Yahoo! India Answers: Share what you know. Learn something new Click here
Catch all the FIFA World Cup 2006 action on Yahoo! India Click here