Skip to main content

Logging Severities

Using System.out.println() for production debugging is a massive anti-pattern. It creates blocking I/O calls scaling poorly and provides zero configuration for turning variables on or off. Standard Logging frameworks resolve this.

Spring Boot relies heavily on SLF4J (Simple Logging Facade for Java) linked to the default underlying standard Logback implementation.

The Severity Levels

Log messages are categorized explicitly by severity. You can instruct the system to ignore messages below a certain threshold to avoid spamming the console files.

  1. TRACE: Extremely verbose output used only for highly granular step-by-step logic tracing.
  2. DEBUG: Useful diagnostic information needed primarily during development tests.
  3. INFO: Normal operational notifications (e.g., "Application started on port 8080").
  4. WARN: Indicates a potential fault that does not currently impact system operations.
  5. ERROR: Represents a massive execution failure (e.g., Database connection timeout).

The default logging level in Spring Boot is INFO. That means any TRACE or DEBUG logs in the codebase are actively hidden by default on runtime.