2 Replies Latest reply on Dec 11, 2002 11:44 AM by cf101

    How do I get log4j to work in my app under J Boss

    ggraham

      Hello all,

      Another complete newbie question I'm sure, but here goes.

      I have been using log4j in most of my java web applications for some time now and I find it very useful. However, when I put this app up under JBoss log4j stopped working and I have been unable to get it to go.

      I am running (forced to) JBoss 2.2.2 with Tomcat 3.2.2.
      I have my log4j.jar file in the WEB-INF/lib directory as always, and in the same directory is my log4j.properties file.

      This setup has always worked in the past (although I've never done it under JBoss).

      What am I missing? No errors, just no log file.

      Thanks,

      Gary

        • 1. Re: How do I get log4j to work in my app under J Boss
          p_d_austin

          Graham,

          Jboss comes with log4j and uses it for the logging of the jboss server.

          This means that the log4j.jar is the one loaded by jboss and the configuration file is the one loaded by jboss. You can find the log4j.xml (or log4j.properties for older versions of jboss) file in the configuration directory of the jboss server. You can modify this file to specify where the log entries go.

          You will probably find your log entries in the jboss log file for now.

          Paul

          • 2. Re: How do I get log4j to work in my app under J Boss
            cf101

            What if this is not a valid solution?

            Has anyone done work on allowing servetl webapplication to use there own log4j instances to log?

            The reason I ask is I have serveral webapps that run in tomcat right now. They work great and do there own logging. If I want to move them to jboss I want them to work EXACLTY like they do today. (That is copy a single war file and 100% of everything including logging is taken care of)

            But because jboss is not loading log4j in it own classloader it and webapps in there own (like Tomcat does) it is causing an issue. Ideas?