Only if you add a logging.properties file to your deployment. Once
you
do that though, you can no longer configure it via the management console.
Hmmm, does this only disable handling via management console,
or does it completely disable whatever you setup via CustomHandlerService and/or
LoggerHandlerService?
We add our own handler to ROOT
final CustomHandlerService chs = new CustomHandlerService(Logger.class.getName(),
"org.jboss.as.capedwarf");
chs.setFormatterSpec(new FormatterSpec() {
public void apply(Handler handler) {
}
});
final String capedwarfLogger = Constants.CAPEDWARF.toUpperCase();
final ServiceName chsName = LogServices.handlerName(capedwarfLogger);
final ServiceBuilder<Handler> chsBuilder = serviceTarget.addService(chsName,
chs);
newControllers.add(chsBuilder.setInitialMode(ServiceController.Mode.ON_DEMAND).install());
final String rootLogger = "ROOT";
final LoggerHandlerService lhs = new LoggerHandlerService(rootLogger);
final ServiceBuilder<org.jboss.logmanager.Logger> lhsBuilder =
serviceTarget.addService(LogServices.loggerHandlerName(rootLogger, capedwarfLogger),
lhs);
lhsBuilder.addDependency(LogServices.loggerName(rootLogger));
lhsBuilder.addDependency(chsName, Handler.class, lhs.getHandlerInjector());
newControllers.add(lhsBuilder.setInitialMode(ServiceController.Mode.ON_DEMAND).install());
[X] But we also setup -- similar to existing LoggingConfigurationProcessor -- our own
LogContext,
if the app explicitly enables it -- via some config property and log.props file.
The problem is, if we have [X] use case, our handler from the code above never gets used /
hit.
Any idea why?
I was working on a concept of logging profiles that could be assigned
to
deployments. Though that would still require a change to the deployment.
It could be interesting to isolate all deployment logging on-demand. Not
quite sure how it would work, but I could see it being useful for debugging.
On 05/24/2012 03:00 PM, Ales Justin wrote:
> Can you already configure loggers per deployment?
> e.g. I want org.hibernate.search at trace for my app, but not for the whole AS
>
> If yes, how?
>
> I mean, is there a better way than adding the old TCCL filter hack I once helped to
write. :)