1 2 3 Previous Next 37 Replies Latest reply on Apr 16, 2004 10:59 AM by lyc1 Go to original post
      • 30. Re: Separate log4j.properties not allowed?
        mtags

        Is it now possible to have a separate log4j.properties file in each jboss application? If it is possible, could someone post an example and also mention where your jndi.properties file is placed within your jar, war, and/or ear.

        I am using jboss 3.0.6 and log4j 1.2.8.

        Thanks

        • 31. Re: Separate log4j.properties not allowed?
          samart

          any update on this? does each app now have its own "Logging Universe"? If so, how do i accomplish that?

          Thanks...

          • 32. Re: Separate log4j.properties not allowed?
            doc_brown

            I was wondering what steps (in Jboss 3.2.1) were required to have seperate Log4J property file. For exampe. the main log4j.xml in conf directory and an application specific log4j.xml in the application WAR.

            • 33. Re: Separate log4j.properties not allowed?
              t644t644

              Still no solution ?

              Regards,

              Stephane

              • 34. Re: Separate log4j.properties not allowed?
                nicola

                > The JBossRepositorySelector will be responsible for
                > assigning each deployment to a Logger Universe.
                > It will do this based on the classloader(s) given to
                > the application at deployment.
                >
                > So when you do for example
                > Logger log = Logger.getLogger()
                >
                > it will really do something like (psuedo-code)
                >
                > Object context =
                > Thread.currentThread().getContextClassLoader();
                > LoggerRepository repository =
                > JBossRepositorySelector.get(context);
                > Logger log = repository.getLogger();
                >
                > Of course this complication is hidden from you.
                > [snip]

                > I'm not entirely sure how to do the initial
                > configuration. I'm open to ideas.
                > The default will be to use the JBoss config.
                >
                > Possibilities are:
                > 1) Look for a log4j.properties or log4j.xml in
                > META-INF
                > 2) A new entry in jboss.xml or jboss-web.xml
                > 3) Use a sar deployment within your app to deploy a
                > Log4jService for your application.

                Reading all the thread i didn't understand if this mechanism has been implemented. I am currently using jboss 3.2.1, and i tried to put a log4j.properties entry in META-INF of my deploy archive, but it does not worked.

                Then, is the mechanism implemented? If so which is the way to configure different log4j configuration per application?

                Thank you for any help you would give to me.

                Best regards,

                -- Nik

                • 35. Re: Separate log4j.properties not allowed?
                  jhalmes

                  I am posting to this thread to bring it to the jboss support staff's attention again. There is no explicit answer for a jboss 3.2.x app server.

                  How do we do application specific logging with log4j without lettting jboss override it? We should not have to reconfigure the app server, that is a less than desirable design IMHO.

                  Think of the case where I am deploying somebody else's war/ear file, why should I have to reverse engineer their logging strategy and then configure jboss in the conf/log4j.xml file? That seems innappropriate for someone that is simply a deployer to have to figure out.

                  As a developer, why can't I just deploy a war/ear file and not have to worry about an appserver taking over my logging?

                  Since Marc Fleury posted back in 2001 agreeing with this viewpoint I am surprised to see answers to similar questions in the forum claiming that this is not possible.

                  What's up with that?

                  -jasen

                  • 36. Re: Separate log4j.properties not allowed?

                    scope your classloader

                    • 37. Re: Separate log4j.properties not allowed?
                      lyc1

                       

                      "juha@jboss.org" wrote:
                      scope your classloader

                      What does that mean ?
                      I'm using several EARs with their own CL, with a log4JService in each, but, as usual, just one log4j configuration is used for the whole server (the last loaded is used !)

                      What to do to have separated log4j instance ?

                      Thanks

                      Damien

                      1 2 3 Previous Next