logger filter-spec does not suppress exceptions in the log in EAP 6

Solution Verified - Updated -

Issue

A web-application is running on JBoss, in the case of an exception it should be written to a file using a file-handler, however, not every exception should be saved. For this I wanted to use the filter-spec of the file-handlers.

<file-handler name="EXCEPTION-FILE" autoflush="true">
        <level name="ERROR"></level>
        <filter-spec value="not(match("MyCustomException"))"></filter>
                <formatter>
                        <pattern-formatter pattern="%d %-5p [%c] (%t) %s%E%n"></pattern>
                </formatter>
        <file path="/var/log/jboss/mylogfile.log"></file>
        <append value="true"></append>
</file-handler>

This configuration should filter out all MyCustomException, however they are still being written to the file.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.