1 Reply Latest reply on Feb 26, 2013 12:36 PM by James Perkins

    AS 7.1.3 logging - org.jboss.as.logging.per-deployment

    Will Tatam Newbie

      If this property is set to true (the default in 7.1.3) then AS7 appears to look for log configuration inside the deployment.

       

      Is it possible to still log to the default log and your own log? For example still display INFO for your application to console (handy for developers as they can then see the state of deployment and also startup logs for your application, e.g loggers created during @Singleton @Startup) but also have say DEBUG log sent to your own log?

       

      Also, under AS5 we were able to attach own own appender programtically which included all details about that deployment, where as the new AS7 logger apppears to only include loggers from your own code. e.g you see loggers from your SFSB but not from AS7 about passivation of that bean in your own per-deployment logs.

       

      I'm looking for the best way to be able to see exactly what is going on in relation to a specific deployment in a single log which lists both my own code and any actvities in AS7 that relate to that deployment e.g bean passivation

        • 1. Re: AS 7.1.3 logging - org.jboss.as.logging.per-deployment
          James Perkins Master

          Is it possible to still log to the default log and your own log? For example still display INFO for your application to console (handy for developers as they can then see the state of deployment and also startup logs for your application, e.g loggers created during @Singleton @Startup) but also have say DEBUG log sent to your own log?

          No, when you add a custom configuration to your deployment it creates a new log context. This means that log statements from your deployment are only passed through that log context and not the system log context where the default loggers and handlers are configured. You would have to add a ConsoleHandler or ConsoleAppender to your deployments logging configuration. I would generally not advise this as it could be an issue with two different contexts writing to the same stream, but it seems to be fairly safe for System.out from my experience. Though note there is nothing in JavaDoc that indicates System.out is thread safe.

           

          You could create a new file handler in the logging subsystem and attach it to a logger with the category of the loggers in your deployment. Then add the handler to that logger.

           

          --

          James R. Perkins