skip to content

What is the difference between `configuredLevel` and `effectiveLevel` in the loggers endpoint response, and what does a null configuredLevel mean?

level: middleimportance: must knowfreq 48%

answer

  1. configured = set on this node (nullable)
  2. effective = resolved by walking up to nearest ancestor with a level
  3. null configured = inherit; OFF = explicitly silence
  4. ROOT always has a level so effective is never null
  5. parent level cascades to null children

basics

~20 s

configuredLevel is the level explicitly set on that logger (can be null if nothing is set). effectiveLevel is the level actually in force after inheriting from parent loggers. A null configuredLevel means the logger inherits its level.

solid answer

~40 s

Loggers form a hierarchy by dotted name under `ROOT`. `configuredLevel` is the level set *directly* on a given logger; it is `null` when nothing was set on it explicitly. `effectiveLevel` is what actually applies at runtime — resolved by walking up the hierarchy to the nearest ancestor with a configured level. So `com.myapp.OrderService` with `configuredLevel=null` but an ancestor `com.myapp` set to `DEBUG` shows `effectiveLevel=DEBUG`. When you `POST {"configuredLevel":null}` you *clear* the direct setting so the logger reverts to inheriting — different from `OFF`, which explicitly silences it. This distinction matters when debugging: setting a level on a parent cascades to all inheriting children, and reading effectiveLevel tells you what a logger will really emit, whereas configuredLevel tells you whether the setting lives on that node or is inherited.

code

java · 13 lines
java
// Given: logging.level.com.myapp=DEBUG ; ROOT=INFO

// GET /actuator/loggers/com.myapp
// { "configuredLevel": "DEBUG", "effectiveLevel": "DEBUG" }

// GET /actuator/loggers/com.myapp.OrderService   (nothing set here)
// { "configuredLevel": null,    "effectiveLevel": "DEBUG" }  // inherited

// GET /actuator/loggers/com.other
// { "configuredLevel": null,    "effectiveLevel": "INFO"  }  // from ROOT

// Reset com.myapp back to inheriting (effectiveLevel becomes INFO):
// POST /actuator/loggers/com.myapp   { "configuredLevel": null }

go deeper

for a junior

Know configuredLevel may be null and effectiveLevel is what actually applies.

for a middle

Explain inheritance up the hierarchy, the worked cascade, and null-vs-OFF precisely.

for a senior

Reason about blast radius when setting parent levels and choosing the narrowest logger to change.

for a principal

Use the model to define operational runbooks for safe live verbosity changes across a service.

## The logger hierarchy Log frameworks organize loggers in a **tree keyed by dotted name**. `com.myapp.web.OrderController`'s ancestors are `com.myapp.web`, `com.myapp`, `com`, and finally the special **`ROOT`** logger at the top. Every logger ultimately descends from ROOT, which always has a level (default `INFO` in Spring Boot). ## configuredLevel `configuredLevel` is the level **explicitly assigned to that specific logger node**. Sources include static config (`logging.level.com.myapp=WARN`) or a runtime `POST` to the loggers endpoint. If nothing set a level on that exact node, `configuredLevel` is **`null`**. ## effectiveLevel `effectiveLevel` is the level **that actually governs whether messages are emitted**. It is computed by **level inheritance**: start at the logger, and if its configuredLevel is null, walk up to the parent, then that parent's parent, until you find a node with a non-null configured level. That found level becomes the effectiveLevel of the original logger. Because ROOT always has a level, effectiveLevel is never null. ### Worked example Suppose config sets `logging.level.com.myapp=DEBUG` and ROOT is INFO. - `com.myapp`: configuredLevel=`DEBUG`, effectiveLevel=`DEBUG`. - `com.myapp.OrderService` (nothing set): configuredLevel=`null`, effectiveLevel=`DEBUG` (inherited from `com.myapp`). - `com.other`: configuredLevel=`null`, effectiveLevel=`INFO` (inherited from ROOT). ## What null means when you POST it `POST /actuator/loggers/com.myapp` with `{"configuredLevel":null}` **removes the direct setting** on `com.myapp`, so it goes back to inheriting from its parent. This is the *reset* operation. Crucially: - **`null` (inherit) is not the same as `OFF`.** `OFF` is an explicit configuredLevel that suppresses all output on that logger and its inheriting children. `null` means "defer to ancestor". ## Gotchas - Reading `configuredLevel` alone can mislead — a logger showing `null` may still emit DEBUG because of an inherited effectiveLevel. Always check `effectiveLevel` to know real behavior. - Setting a level on a **parent cascades** to all children whose configuredLevel is null. Turning `com.myapp` to TRACE can flood logs from many child loggers at once. - Setting a level on a **child overrides** the inherited parent value for that child only. - The endpoint may report loggers that only exist because a level was configured for a package that has no logger instance yet — the name still appears. ## When it matters This mental model is essential when using the endpoint for surgical debugging: choose the **narrowest logger name** that captures the code path so you raise verbosity for exactly the right subtree, and read effectiveLevel to confirm what will actually be logged.

  • If a logger's configuredLevel is null, can it still be emitting DEBUG messages?
    Yes. effectiveLevel is inherited from an ancestor. If a parent (or ROOT) is set to DEBUG, the child with null configuredLevel emits DEBUG. Read effectiveLevel to know actual behavior.
  • How do you fully silence a specific logger versus letting it inherit?
    Silence it by POSTing configuredLevel OFF (explicit). Let it inherit by POSTing configuredLevel null, which clears the direct setting so it defers to its parent's level.

saying these in an interview costs you the question

  • Treating configuredLevel and effectiveLevel as the same thing
  • Believing null configuredLevel means no logging happens (it means inherit)
  • Confusing null (inherit) with OFF (explicit silence)
  • Thinking effectiveLevel can be null

context