Mixed message transformation by multiple filter specs in different handlers
Issue
If a logger lists two handlers, and each handler has a filter-spec
that modifies messages by levelChange
or substitute/substituteAll
filter expression, the message conversion result by filters seems to get mixed. As an example, if the following is configured in the logging subsystem:
<periodic-rotating-file-handler name="ACCESS_LOG_FILE_1" autoflush="true">
...
<filter-spec value="substituteAll("\"", "\'")"/>
</periodic-rotating-file-handler>
<periodic-rotating-file-handler name="ACCESS_LOG_FILE_2" autoflush="true">
...
<filter-spec value="all(levelChange(WARN),substituteAll(":", "-"))"/>
</periodic-rotating-file-handler>
<logger category="io.undertow.accesslog" use-parent-handlers="false">
<level name="INFO"/>
<handlers>
<handler name="ACCESS_LOG_FILE_1"/>
<handler name="ACCESS_LOG_FILE_2"/>
</handlers>
</logger>
Two expression filters are applied to one handler and only one filter to the other:
// message in ACCESS_LOG_FILE_1 handler. Both ACCESS_LOG_FILE_1 and ACCESS_LOG_FILE_2 filter expression is applied.
2023-05-24 18:05:36,394 WARN [io.undertow.accesslog] (default task-1) 127.0.0.1 - - [24/May/2023-18-05-36 +0900] 'GET / HTTP/1.1' 200 1531
// message in ACCESS_LOG_FILE_2 handler. Only ACCESS_LOG_FILE_2 filter expression is applied.
2023-05-24 18:05:36,394 WARN [io.undertow.accesslog] (default task-1) 127.0.0.1 - - [24/May/2023-18-05-36 +0900] "GET / HTTP/1.1" 200 1531
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.