4 Replies Latest reply on Dec 4, 2004 3:14 PM by Bob Nelson

    Log4J Example in the Wiki Not Working

    Chip Anderson Newbie

      I'm trying to configure JBoss so that it uses the Log4J configuration file in my WAR rather than the JBoss one in /conf. I found several posts in these forums where similar questions were asked. The answers usually pointed the user to a Wiki entry about logging:

      http://www.jboss.org/wiki/Wiki.jsp?page=Logging

      In the middle of that page, there is a section entitled "Using your own log4j.xml file - class loader scoping" which seems to contain the answer that I'm looking for - just create a jboss-web.xml file that looks like the one in the article and add it to your project's WEB-INF directory. Excellent.

      Unfortunately, it didn't seem to work. My log entries still appeared in the JBoss console rather than where I wanted them to. Things work fine under Tomcat, so I'm 95% sure my Log4J config is correct.

      As a test, I downloaded and installed the sample file (confusingly) called "Log4J.war" from the Wiki page and installed it. When I pulled up its "snoop.jsp" file, it's log entries also appeared on the JBoss console and not in "{server}/log/log4j-test.log".

      Does anyone know if there anything else that needs to be configured in order for the Wiki example to work? What version of JBoss is required? Can anyone else get "Log4J.war" to log to its file rather than to the console?

      TIA