JBoss EAP 6.4 logging filter-spec
doc_fire Oct 6, 2015 5:56 AMI'm trying to use the "filter-spec ..." definition independently for different handlers.
The problem is that there is some kind of inheritance that I really cannot figure out: When using the "filter-spec ..." within the console-handler the filter is also applied within the size-rotating-file-handler but not the other way round.
I want to use the filter within the console-handler only for the console-handler and the filter within the size-rotating-file-handler only for the size-rotating-file-hanlder.
Current configuration looks similar to this (I've also tried it without the "filter-spec value="accept"" within the root-logger)
<subsystem xmlns="urn:jboss:domain:logging:1.5">
        <console-handler name="CONSOLE">
            <level name="DEBUG"/>
            <filter-spec value="all(substituteAll("\n","/n"), substituteAll("\r","/r"), substituteAll("\t","/t"))"/>
            <formatter>
                <named-formatter name="DEFAULT_LOG_PATTERN"/>
            </formatter>
        </console-handler>
        <size-rotating-file-handler name="SFILE">
            <level name="INFO"/>
            <filter-spec value="all(substituteAll("a","AA"), substituteAll("e","EE")), levels(INFO)"/>
            <formatter>
                <named-formatter name="DEFAULT_LOG_PATTERN"/>
            </formatter>
            <file relative-to="jboss.server.log.dir" path="sizerotated.log"/>
            <rotate-size value="1M"/>
            <max-backup-index value="15"/>
            <append value="true"/>
        </size-rotating-file-handler>
        <logger category="org.hibernate.SQL">
            <level name="DEBUG"/>
            <filter-spec value="accept"/>
        </logger>
        ...
        <root-logger>
            <level name="INFO"/>
            <filter-spec value="accept"/>
            <handlers>
                <handler name="CONSOLE"/>
                <handler name="SFILE"/>
            </handlers>
        </root-logger>
        <formatter name="DEFAULT_LOG_PATTERN">
            <pattern-formatter pattern=""%d{yyyy-MM-dd HH:mm:ss.......;%E";%n"/>
        </formatter>
    </subsystem>
I found out that if the order of the handlers within the "root-logger" is changed to:
<handler name="SFILE"/> <handler name="CONSOLE"/>
then the inheritance is the other way round.
 
    