Created
August 22, 2019 10:33
-
-
Save jsvd/2ceed2eccf1c14f197ce791a302af838 to your computer and use it in GitHub Desktop.
how to filter out an multi line error message in log4j2 using RegexFilter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appender.console.type = Console | |
appender.console.name = plain_console | |
appender.console.layout.type = PatternLayout | |
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %m%n | |
appender.console.filter.no_json_error.type = RegexFilter | |
appender.console.filter.no_json_error.regex = (?s).*JSON parse error.* | |
appender.console.filter.no_json_error.onMatch = DENY | |
appender.console.filter.no_json_error.onMismatch = ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note the
(?s)
, a.k.a. as DOTALL: