Skip to content

Highlighting Patterns

Ilia Smirnov edited this page Nov 12, 2024 · 3 revisions

Highlighting patterns (shown under "Patterns" in settings) allow you to customize the way your log is highlighted.

Specifying a custom highlighting pattern

Each highlighting pattern consists of Java regular expression pattern and action to be applied if it matches.

The pattern is applied to capture groups from Log Format that was detected for the file. Make sure the parsing pattern is successfully recognized, otherwise the proper highlighting isn't guaranteed.

Pattern

The "Pattern" determines a log event piece to highlight.

Please note that the pattern is applicable only within particular capture groups from log format. It's impossible to match pattern against multiple capture group at the same time.

Action

There are 3 available actions to be applied:

  • "Highlight line" - highlights the whole log event with configured style
  • "Highlight field" - highlights only the field (capture group) where the match occurred
  • "Highlight match" - highlights all occurrences of the matched text

If multiple patterns match a log event, they are applied in the order of actions indicated above (line, then field, then match). If multiple patterns for the same action match, the last one is applied. This way, it's possible to highlight both whole line and a field in it with different colors.

Log Format

If "Any" is selected, the highlighting pattern will be applied to all recognized log files.

Specify the log format to improve highlighting performance.

Capture group

If you don't have a capture group for highlighting pattern or you want to apply the pattern for every capture group, select 0.

Specify the capture group to improve highlighting performance if it's possible

Other

You can configure the foreground and background colors for highlighting, bold or italic font styles (for multi-line messages, these will be applied only to the first line), or add a mark to error stripe (scrollbar).

The three bundled patterns highlight messages according to their severity, additionally showing errors in bold and on error stripe.

Known issues

There is no user-visible validation performed on patterns. If your pattern is invalid, it will simply be ignored.

Clone this wiki locally