-
1. Re: AS 7.1.3 logging - org.jboss.as.logging.per-deployment
jamezp Feb 26, 2013 12:36 PM (in response to will.tatam)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