3 Replies Latest reply on Sep 16, 2002 2:09 AM by tek1

    setting logging threshold on per app basis?

    tek1 Newbie

      in the case where there may be several application running in deploy/default, is it possible to only change the logging threshold (i.e. from INFO to DEBUG) on per application basis, so that the other applications do not start logging debug messages? thank you.

        • 1. Re: setting logging threshold on per app basis?
          Mike Finn Apprentice

          The key is for each app to log to unique categories. If your apps are discernible by the Java packages in which the respective app classes reside, then base your categories on package name (or variant of).

          For example:
          app_a classes in : com.bar.foo.app_a.*
          app_b classes in : com.bar.foo.app_b.*

          and your categories are created via:

          Category cat = Category.getInstance(com.bar.foo.app_a.Some.class);

          Category cat = Category.getInstance(com.bar.foo.app_a.Some.class);

          or using getClass().getName(),

          Then, in log4j.xml:








          app_a will log info msgs and app_b will show debug msgs.

          HTH,
          Mike

          • 2. Re: setting logging threshold on per app basis?
            Mike Finn Apprentice

            The key is for each app to log to unique categories. If your apps are discernible by the Java packages in which the respective app classes reside, then base your categories on package name (or variant of).

            For example:
            app_a classes in : com.bar.foo.app_a.*
            app_b classes in : com.bar.foo.app_b.*

            and your categories are created via:

            Category cat = Category.getInstance(com.bar.foo.app_a.Some.class);

            Category cat = Category.getInstance(com.bar.foo.app_a.Some.class);

            or using getClass().getName(),

            Then, in log4j.xml:








            app_a will log info msgs and app_b will show debug msgs.

            HTH,
            Mike

            • 3. Re: setting logging threshold on per app basis?
              tek1 Newbie

              great! thank you very much!