tags:

views:

39

answers:

1

I'm trying to use log4j in JSP web application over Jboss 4.2 My problem is that I can't set the logger to use the properties file. Here are the steps I done:

  1. copy log4j.properties to WEB-INF folder

  2. My code: <%@ page import="org.apache.log4j.Logger" %> <%@ page import="org.apache.log4j.PropertyConfigurator" %>

<% org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("ApplicationA"); log.debug("Debug message"); %>

  1. I tried to add to web.xml: log4jConfigLocation /WEB-INF/log4j.properties

The logger is worked but seems that with some default properties, e.g. only info messages are shown and it don't use the appenders in the config file

What do I miss here?

+1  A: 

log4j.properties needs to go in /WEB-INF/classes, not /WEB-INF

skaffman