Logsflags: g
Log Level
Matches standard log level keywords in log lines.
Try it in RegexProPattern
regexJavaScript
/\b(TRACE|DEBUG|INFO|WARN|ERROR|FATAL)\b/gRaw source: \b(TRACE|DEBUG|INFO|WARN|ERROR|FATAL)\b
How it works
`\b(TRACE|DEBUG|INFO|WARN|ERROR|FATAL)\b` matches any of the six standard log levels as whole words.
Examples
Input
[INFO] Server started. [ERROR] Connection failed.Matches
INFOERROR
Input
DEBUG: cache missMatches
DEBUG
Common use cases
- Log filtering
- Alerting
- Error triage
Related concepts
Alternation with the | Operator
ConceptThe pipe | matches either the expression on its left or on its right. Combine with groups to alternate over a subpattern.
How to Match Multiple Patterns (Alternation)
How-toCombine patterns with | to match either option. Wrap alternatives in a group to scope the alternation correctly.