2 Replies Latest reply on Jun 26, 2002 9:30 AM by cnsxxx09

    startup mbean & logging

    cnsxxx09

      Hi,

      I want my application to log to a separate log file, and I want this to be App. Server independent, so I created an MBean using the documentation as a guide. This initialises Log4j.

      I created the following entry in $JBOSS_HOME/server/default/deploy/user-service.xml

      From http://localhost:8082 I can see that it has started:
      * user: service=Startup,jndiName=inmemory/Logger
      (and no startup exception was thrown).

      However, any logging I do goes to the default JBoss log file.

      Can I achieve what I want to achieve using a Startup MBean? If so, is there anything special I need to do in my Session Beans before calling: org.apache.log4j.Category.getInstance

      TIA

      Chris

        • 1. Re: startup mbean & logging
          davidjencks

          I don't think you can have 2 copies of log4j running at the same time in jboss, certainly not in the same LoaderRepository (essentially "classloader").

          Can't you do what you want by setting up the log4j.xml file appropriately?

          • 2. Re: startup mbean & logging
            cnsxxx09

            Ta for the reply.

            In order to convince management to switch from WebLogic to JBoss I am making sure the application runs in both before the decision is influenced, erm I mean made.

            This seemed the best solution I could think of to allow App Server independent logging - AFAIK WebLogic doesn't use Log4j and has it's own logging API.

            Chris