logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Cherouvim ...@eworx.gr>
Subject Re: unable to setup log4j for tomcat
Date Thu, 06 Oct 2005 14:52:17 GMT
Hello

log4j.properties in WEB-INF/classes works when running my classes from 
netbeans. The log file is created.
I have log4j-1.2.12.jar in WEB-INF\lib

and in my classes or JSPs I do:
Logger logger = Logger.getLogger(Person.class);
logger.info("foo bar");

But when I run a JSP from tomcat and want to log I cannot seem to be 
able to find where (and if) is the file created and appended.
Having set -Dlog4j.debug in my Tomcat parameters I get

 INFO [http-8080-Processor25] (index_jsp.java:68) - XXXXXXXXX
 INFO [http-8080-Processor25] (index_jsp.java:68) - XXXXXXXXX

where 'XXXXXX' is some other message I logged from index.jsp

Any help?
I am really confused here..



Jacob Kjome wrote:

>Why WEB-INF/classes/properties?  Are you performing your own manual
>configuration, because Log4j's auto-configuration won't find the file unless it
>is in the default package.  Secondly, where is log4j.jar?  If it isn't in
>WEB-INF/lib but a higher classloader such as CATALINA_HOME/common/lib, then
>Log4j has already attempted autoconfiguration at application startup and won't
>do it again when you deploy your webapp.  Thirdly, if you have a log4j.xml file
>somewhere in your classpath such as CATALINA_HOME/common/classes or in some
>miscreant jar packaging its own log4j config file, then Log4j autoconfiguration
>will grab the log4j.xml file in preference to your own log4j.properties file
>(assuming that you are counting on autoconfiguration and not performing manual
>configuration upon application startup).
>  
>


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