Scrivio Interview library
ScenarioIntermediate7 min read · updated 12 November 2026

Someone set the root logger to DEBUG in production through the loggers endpoint during an incident and forgot it. Disk filled and latency rose. What controls would you add?

I would add controls at every step of what went wrong. Only operators may write to the loggers endpoint, and the root logger is blocked entirely so people change a specific logger or group instead. Any changed level is reverted automatically after a time window, for example 30 minutes. Log volume per service is measured and alerted on, and services log only to stdout so the platform, not the pod's disk, enforces rate limits and retention.

Why this question is asked

Changing log levels at runtime is one of the most useful tools during an incident, which is exactly why it gets used under pressure and then forgotten. Root at DEBUG turns on debug output in every library at once, from the HTTP server to the connection pool, and volume can grow a hundred times. Disks fill, the logging itself costs CPU and I/O, and latency rises. Interviewers ask this scenario to see whether we respond with controls rather than blame. In this answer, we will see why root DEBUG is so costly, then add the controls one by one: access, scope, automatic revert, volume alerts and platform-enforced limits.

1What Happened and Why It Hurt

During an incident, an engineer called the loggers endpoint to set the root logger to DEBUG. The root logger is the top of the logger hierarchy, so every logger without its own level inherits from it. That includes Spring, Tomcat, Hibernate, HikariCP, the Kafka client and the AWS SDK, all of which log a lot at DEBUG.

The incident ended and nobody reset the level. The service had been writing about 50 log lines per second; at root DEBUG it wrote around 5,000. It was configured to write log files to the pod's disk as well as stdout, and the disk filled within hours. Meanwhile each request spent time formatting and writing debug lines, often synchronously, so latency rose. Notice that nothing here was malicious or even unusual. The tool did exactly what it was asked, and nothing brought it back.

Step throughHow one forgotten change became an outage
  1. Incident: root set to DEBUG via /actuator/loggers
  2. Every library inherits DEBUG50 -> 5,000 lines per second
  3. Is the level reverted after the incident?
    YesVolume returns to normalNoDebug output continues
  4. Local log file fills the diskand synchronous writes add latency
  5. Service degrades hours laterthe cause is far from the change

5 steps in order. Play them, or step through them one at a time.

2Control 1: Only Operators Can Write

The loggers endpoint should be reachable only on the internal management port, and its write operation only by an operator role. Reading levels is harmless and can stay open to more people. In the actuator security chain, we also block changes to the root logger altogether, so even operators have to choose a narrower target.

Java
// Actuator SecurityFilterChain (paths assume the default /actuator base path)
.authorizeHttpRequests(auth -> auth
.requestMatchers(EndpointRequest.to("health")).permitAll()
.requestMatchers(HttpMethod.POST, "/actuator/loggers/ROOT").denyAll() // never root
.requestMatchers(HttpMethod.POST, "/actuator/loggers/**").hasRole("OPS")
.requestMatchers(HttpMethod.GET, "/actuator/loggers/**").hasAnyRole("OPS", "DEV")
.anyRequest().hasRole("OPS"))
# POST /actuator/loggers/ROOT {"configuredLevel":"DEBUG"} -> 403
# POST /actuator/loggers/billing {"configuredLevel":"DEBUG"} -> 204 (OPS user)

The deny rule must come before the general POST rule, because Spring Security uses the first matching rule. Path rules like these must also follow the base path, so they belong in the shared platform configuration where they are maintained once.

3Control 2: Change Groups, Not Root

The safe habit is to raise only the loggers we need. Spring Boot's log groups make that easy: a team defines groups in advance for its common investigations, such as logging.group.payments=com.acme.payments,org.hibernate.SQL, and the runbook says which group to raise for which symptom. Boot also has predefined web and sql groups. Raising one group typically adds a few hundred lines per second at most, not thousands, and it gives a more readable log because it is not buried in library noise.

4Control 3: Revert Levels Automatically

People forget, so the system should not depend on remembering. The loggers endpoint has no built-in expiry, but the platform starter can add one. A scheduled task compares the current configured levels with the ones that applied at startup and resets any change that has been in place longer than the allowed window.

Java
@Component
class LogLevelReverter {
private static final Logger log = LoggerFactory.getLogger(LogLevelReverter.class);
private static final Duration WINDOW = Duration.ofMinutes(30);
private final LoggingSystem logging;
private final Map<String, LogLevel> baseline = new HashMap<>();
private final Map<String, Instant> firstSeen = new HashMap<>();
LogLevelReverter(LoggingSystem logging) { this.logging = logging; }
@EventListener(ApplicationReadyEvent.class)
void captureBaseline() {
logging.getLoggerConfigurations()
.forEach(c -> baseline.put(c.getName(), c.getConfiguredLevel()));
}
@Scheduled(fixedDelay = 60_000)
void revertExpired() {
Instant now = Instant.now();
for (LoggerConfiguration c : logging.getLoggerConfigurations()) {
String name = c.getName();
if (Objects.equals(c.getConfiguredLevel(), baseline.get(name))) {
firstSeen.remove(name);
continue;
}
Instant since = firstSeen.computeIfAbsent(name, n -> now);
if (Duration.between(since, now).compareTo(WINDOW) > 0) {
logging.setLogLevel(name, baseline.get(name)); // back to the startup level
firstSeen.remove(name);
log.warn("Reverted log level of {} after {}", name, WINDOW);
}
}
}
}
// 10:00 POST /actuator/loggers/billing DEBUG
// 10:31 WARN Reverted log level of com.acme.billing after PT30M

Because the check runs every minute, a level is reverted between 30 and 31 minutes after it was changed. The reverter needs scheduling enabled with @EnableScheduling, and it works on individual loggers, so changing a group is reverted logger by logger. An operator who really needs longer can raise the level again; the warning log line and an audit record of the original change make it all visible.

5Control 4: Alert on Log Volume

Even with these controls, something else will one day produce a flood of logs, such as a retry loop. A volume alert catches every cause. Spring Boot registers a Micrometer counter for Logback events, logback.events, tagged by level, so we can alert on unusual rates without touching the log platform.

Java
# PromQL alert: DEBUG lines from a service in production, for more than 10 minutes
sum by (job) (rate(logback_events_total{level="debug", env="production"}[5m])) > 0
# PromQL alert: total log rate five times higher than the same time last week
sum by (job) (rate(logback_events_total[10m]))
> 5 * sum by (job) (rate(logback_events_total[10m] offset 1w))

The first alert is strict on purpose: in production, sustained DEBUG output should always be a deliberate, temporary choice, so it is worth a notification to the owning team.

6Control 5: Stdout Only, With Platform Limits

Finally, the service should not write log files to its own disk at all. It logs to stdout, the node's log agent collects it, and the platform applies a per-service rate limit and retention. When a service floods, the agent drops or samples the excess DEBUG and INFO lines while keeping WARN and ERROR, and the pod's disk is never involved. That turns a full disk outage into, at worst, some lost debug lines and an alert.

Which control catches which part of the failure
ControlStops
Operator-only writesCasual changes by anyone
Deny POST to ROOTThe widest, most expensive change
Automatic revert after 30 minForgotten changes
Log volume alertsFloods from any cause
Stdout with platform limitsFull disks and runaway ingestion

7Follow-up questions

Why not just remove the loggers endpoint?

Because raising one logger for a few minutes is one of the fastest ways to understand a production problem without a redeploy. Removing it pushes people towards redeploying with changed configuration, which is slower and riskier. Controls keep the benefit and remove the danger.

Could you use asynchronous logging to protect latency?

It helps: an AsyncAppender moves writing off the request thread, so slow I/O does not add latency directly. But under a flood its queue fills, and it then either blocks or drops events depending on configuration. It reduces the latency effect but does not fix the volume, so it complements the controls rather than replacing them.

How would you make the change visible to the team?

Log every write to the loggers endpoint as an audit event with the user, the logger and the level, and post it to the service's channel. A change that everyone can see is much less likely to be forgotten.

8Conclusion

In this answer, we turned an incident into controls. Writes to the loggers endpoint are limited to operators and the root logger is blocked, so people raise specific groups instead. A scheduled reverter restores the startup levels after 30 minutes, volume alerts on logback.events catch floods from any cause, and logging only to stdout lets the platform enforce rate limits and retention instead of a pod's disk filling up.

What to say in the interviewAbout 80 seconds aloud

Open with

I would treat it as a missing-controls problem, not a person problem, and add a control at each step. First, access: the loggers endpoint sits on the internal management port, only an operator role can POST to it, and I deny POST to /actuator/loggers/ROOT in the security chain, because root at DEBUG turns on every library and can multiply volume by a hundred.

Then, if they want more

Second, scope: teams define log groups for their usual investigations, so the runbook says raise the payments group, not root. Third, automatic revert: the loggers endpoint has no expiry, so the platform starter adds a scheduled task that remembers the startup levels through LoggingSystem and resets any change older than thirty minutes, with a warning log.

Fourth, an alert on log volume per service, using the logback.events counter that Boot registers, for example any sustained DEBUG output in production or a rate five times higher than last week.

Fifth, services log only to stdout, never to files on the pod's disk, and the platform's log agent enforces per-service rate limits and retention, keeping WARN and ERROR when it samples. Then a forgotten change costs at most some dropped debug lines and an alert, not a full disk and higher latency.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Boot reference
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Someone set the root logger to DEBUG in production through the loggers endpoint during...": https://scrivio-interview-library.netlify.app/spring-boot/boot-logging/1600933f14/