Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.11.1
-
None
Description
When using the jul-bridge and %highlight in the pattern layout, LogLevels that are not mapped to log4j LogLevels incorrectly display "null" in front of the highlighted string.
See the following pattern:
{{pattern="%d %highlight
{%-6p} [%c{1.}] (%t) %m%n"}}that should display the loglevel with color highlighting.
The following log statements:
{{
LOGGER.log(Level.SEVERE, "SEVERE");
LOGGER.log(Level.WARNING,"WARN");
LOGGER.log(Level.INFO, "INFO");
LOGGER.log(Level.FINE, "FINE");
LOGGER.log(Level.FINER, "FINER");
LOGGER.log(Level.FINEST, "FINEST");
LOGGER.log(Level.CONFIG, "CONFIG");
}}
will be displayed as in the attached picture.
As you can see the FINEST and CONFIG levels are not highlighted (which is acceptable), but are prefixed by "null", which is not acceptable.
I think it would be well enough to support setting the style for such unknown log levels like:
{{pattern="%d %highlight{%-6p} {FINEST=black, CONFIG=blue}
[%c
{1.}] (%t) %m%n"}}
This would also allow to set a color different than black for these log levels.
Attachments
Attachments
Issue Links
- links to