2 Replies Latest reply on Dec 18, 2017 12:40 AM by sflanigan

    How to tell loggers to inherit filters from the parent?

    sflanigan

      This relates to the old discussion Re: JBoss 7 log configuration not working as expected  and [LOGMGR-45] Have loggers inherit filters - JBoss Issue Tracker

       

      I have a similar problem because I need to see the stack trace whenever Weld catches an exception, which it then logs as DEBUG with one of 21 different loggers. Ideally I would use configuration almost like this on the top-level log category:

       

      /subsystem=logging/logger=org.jboss.weld:add

      /subsystem=logging/logger=org.jboss.weld:write-attribute(name=level,value=DEBUG)

      /subsystem=logging/logger=org.jboss.weld:write-attribute(name=filter-spec, value="any(match(\"Catching\"), levelRange[INFO, FATAL])")

       

      I gather jamezp added the ability to inherit filters from parent loggers back in 2015 (Logger now has a method setUseParentFilters),  but I can't work out how to use it. How can I set the logger attribute useParentFilters from JBoss CLI (or standalone*.xml) so that the filter can be inherited by child loggers? And would I set it on the parent logger, or would I have to set it on each of the child filters?