[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-user
Subject:    Re: [newbie] log4j and tomcat
From:       Didier Bretin <dbr () informactis ! com>
Date:       2002-05-14 13:30:41
[Download RAW message or body]

Oops, in fact I forgot to initialise it with DOMConfigurator.

So now it works :o).

On Tue, 14 May 2002 14:56:26 +0200
Didier Bretin <dbr@informactis.com> wrote:

> Hello,
> 
>   First, I'm with: tomcat-4.0.3 and log4j-1.2
> 
>   The example 2 of the manual tells me to do:
>      export TOMCAT_OPTS="-Dlog4j.configuration=foobar.xml"
> 
>   So I do and launch tomcat: ./bin/catalina.sh start
> 
>   And before I create a foobar.xml file in my webapps/WEB-INF/classes directory.
> 
>   When I launch my servlet I got this error:
> 
> log4j:WARN No appenders could be found for logger (com.informactis.mypackage).
> log4j:WARN Please initialize the log4j system properly.
> 
> My servlet is simple as this:
> 
> import javax.servlet.*;
> import javax.servlet.http.*;
> import org.apache.log4j.Logger;
> import java.io.*;
> 
> public class Exemple extends HttpServlet
> {
> 	private static Logger logger = Logger.getLogger ( "com.informactis.mypackage" );
> 
> 	protected void doGet ( HttpServletRequest req, HttpServletResponse res)
> 	throws ServletException, IOException
> 	{
> 		res.setContentType("text/html");
> 		res.setHeader("pragma", "no-cache");
> 		PrintWriter out = res.getWriter();
> 		out.print("test");
> 		out.close();
> 		
> 		logger.debug ( "didier" );
> 	}
> }
> 
> Do I forgot something ?!?!
> 
> Thanks for your help.
> -- 
>             .------------------------------------------------.
>     .^.     | Didier Bretin, France | dbr@informactis.com    |
>     /V\     |-----------------------| www.informactis.com    |
>    // \\    |                       `------------------------|
>   /(   )\   | Visit: http://www.vim.org/                     |
>    ^^-^^    `------------------------------------------------'
> 
> --
> To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>
> 


-- 
            .------------------------------------------------.
    .^.     | Didier Bretin, France | dbr@informactis.com    |
    /V\     |-----------------------| www.informactis.com    |
   // \\    |                       `------------------------|
  /(   )\   | Visit: http://www.vim.org/                     |
   ^^-^^    `------------------------------------------------'

--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic