1 Reply Latest reply on May 12, 2011 3:32 AM by Wolf-Dieter Fink

    Reloading log configuration in JBoss 6 AS

    anonimo Newbie

      I am currently trying to configure logging in JBoss 6 and looking at the different alternatives. My requirements are:

      1) Automatic reload of any log configuration changes without application re-deployment.

      2) Multiple log files one for each log level. E.g. one myApp-error.log that logs only error messages, myApp-debug.log that logs only debug messages, etc. This means being able to set minimum and maximum levels for each of the appenders/handlers set for each file.

      Now, I know I can use the jboss-logging.xml file which is shipped with JBoss 6 AS. I do get automatic reload by using this file as it takes advantage of the hot deployment feature in JBoss (this file is located in the deploy directory).

      However, I can't get to configure my log to set a maximum level for each of the handlers. I can set a minimum level, but that means that e.g. my debug file will get debug and all levels above. Not what I need.

      Other option would be using an external configuration file. E.g. log4j.xml. This can be achieved by setting a system property as stated here. Good since I can use a org.apache.log4j.varia.LevelRangeFilter filter to limit the maximum and minimum log levels. However this doesn't allow for automatic reload of logging configuration without re-deploying the application.

      Is there any chance I can get both requirements using JBoss 6 AS whether with the shipped logging system or with an external one?

        • 1. Reloading log configuration in JBoss 6 AS
          Wolf-Dieter Fink Master

          I'm not familar with the new jboss-logging in JB6, but


          we have a similar issue, we want to separate logs for different applications in different logfiles which are logged eventually by the same log4j.Logger.

          The outcoming problem is that you will have locking contention because the appender must be syncronized in some cases and filtering within the appender might produce a massive performance decrease.