Skip to main content
Regexflux

Log Level

beginner

Matches common log level indicators (DEBUG, INFO, WARN, ERROR, FATAL).

loglevelseverityfiltering

Pattern

/\b(?:DEBUG|TRACE|INFO|WARN(?:ING)?|ERROR|FATAL|CRITICAL)\b/gi

Try It

0 of 7 strings matched

Explanation

Matches standard log severity levels as whole words. Handles both WARN and WARNING variants. Case-insensitive.

Test Strings

Matching

  • ERROR: something failed
  • [INFO] Starting server
  • WARN: deprecated API
  • CRITICAL failure

Non-matching

  • information
  • no level here
  • DEBUGGER

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOLimited support (ASCII-only word boundaries)

Code Snippets

const regex = /\b(?:DEBUG|TRACE|INFO|WARN(?:ING)?|ERROR|FATAL|CRITICAL)\b/gi;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Related Patterns