Scrivio Interview library
LeadershipAdvanced6 min read · updated 12 November 2026

Engineers can change log levels through Actuator in production, and twice this year someone set the root logger to DEBUG, which filled disks and doubled log costs. Write the policy and technical guard rails you would put in place.

The policy is that runtime level changes are an operational action with an owner, a reason, a scope and an end time, and the guard rails make that the only possible way. The Actuator loggers endpoint is closed to people and reachable only by one audited tool, the tool refuses the root logger and whole frameworks and reverts every change automatically, the platform caps volume per service in the shipper with alerts on sudden growth, targeted per-tenant or per-request DEBUG is the preferred option, and every logging-caused incident is reviewed so the rails are adjusted.

Why this question is asked

Twice in a year someone set the root logger to DEBUG in production, disks filled and the log bill doubled. Nobody did this out of malice; they were under pressure during an incident and the tool let them. Interviewers ask this leadership question to see whether we respond with blame or with a system that makes the safe choice easy and the dangerous one impossible. In this answer, we will write the policy in plain terms, then build the technical guard rails layer by layer: access control on the endpoint, one audited tool with limits and automatic revert, volume caps in the platform, targeted debugging as the default, and a post-incident loop that keeps the rules current.

1Why Root DEBUG Is So Damaging

The root logger is the parent of every logger in the application, so setting it to DEBUG switches on debug output for every framework and library at once: Spring's bean and request handling, Hibernate's SQL and parameter binding, the HTTP client's wire logs, Kafka's consumer internals. A service that writes 2 MB of logs a minute at INFO can easily write 200 MB a minute at root DEBUG. Across 30 pods that is 6 GB a minute, enough to fill node disks in under an hour and to multiply the ingest bill within a day.

It is also usually useless: the engineer wanted detail from one package, and the useful lines are buried among millions of framework messages. So the guard rails cost the engineer nothing they actually needed.

2The Policy, in Plain Words

I would keep the written policy short enough to read during an incident. Runtime level changes in production are allowed, through the logging tool only. Each change names the service, the logger, the level, the reason or incident, and an end time. Changes are limited to the service's own packages; the root logger and framework packages require a second person. The default duration is 30 minutes and the maximum 4 hours, after which changes revert automatically. Per-tenant or per-request DEBUG should be tried first when the problem is limited to some requests. And every change is visible in the incident channel.

Notice what the policy does not say: it does not say 'never use DEBUG in production'. Engineers need detail during incidents, and a policy that forbids it would simply be bypassed.

3Guard Rail 1: Close the Endpoint to People

Today engineers call Actuator directly, so nothing can enforce scope or duration. The first step is to make the loggers endpoint reachable only from the tool: serve Actuator on a separate management port that is not exposed through the ingress, require authentication, and restrict the loggers endpoint to a service identity that only the tool holds.

Java
# application.properties in the shared starter
management.server.port=8081 # not routed by the public ingress
management.endpoints.web.exposure.include=health,info,prometheus,loggers
// Spring Security: only the logging tool's identity may change levels
@Bean
SecurityFilterChain management(HttpSecurity http) throws Exception {
http.securityMatcher(EndpointRequest.toAnyEndpoint())
.authorizeHttpRequests(a -> a
.requestMatchers(EndpointRequest.to("health", "info", "prometheus")).permitAll()
.requestMatchers(EndpointRequest.to("loggers")).hasAuthority("SCOPE_logging.write")
.anyRequest().denyAll())
.oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults()));
return http.build();
}
// engineer with a personal token: POST /actuator/loggers/ROOT -> 403 Forbidden
// logging tool with logging.write scope: POST /actuator/loggers/com.shop.payment -> 204

4Guard Rail 2: One Audited Tool With Limits and Revert

The tool is where the policy becomes code. It checks the logger name against the service's allowed prefixes, refuses ROOT and framework packages unless a second person approves, caps the level and duration, applies the change to every pod, and schedules the revert. It also writes an audit record and posts it to the incident channel.

Step throughHow the tool handles a request
  1. Request: service, logger, level, duration, reason
  2. Logger is ROOT or a framework package?
    YesRequire second approvalNoContinue
  3. Level and duration within caps?
    YesContinueNoReject with the limits
  4. Apply to all pods, record audit, post to channel
  5. Revert at expirypods also revert locally if the tool is down

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

5Guard Rail 3: Volume Caps in the Platform

Even with a good tool, something will eventually produce a flood: a bug, a new library, a misread configuration. So the platform needs a cap that does not depend on the application. The node shipper or collector applies a per-service rate limit, for example ten times the service's normal volume, and drops or samples the excess while emitting a counter. An alert fires when a service's volume doubles against its weekly average, routed to the owning team and the platform on-call. Node disks get log size limits through the container runtime's log rotation, so a flood cannot fill a node.

Step throughGuard rails from the person to the platform
  1. Policyowner, reason, scope, end time
  2. Accessloggers endpoint only reachable by the tool
  3. Toolallowed prefixes, caps, automatic revert, audit
  4. Targeted debuggingper-tenant or per-request DEBUG first
  5. Platform capsshipper rate limits, disk limits, volume alerts

5 layers, from the top down. Step through them one at a time.

6Make Targeted Debugging the Default, and Learn From Each Incident

The best way to stop people raising global levels is to give them something better. If the tool's first question is 'which tenant, user or request id?', and it can switch on DEBUG through an MDC-based filter for just that key, most incidents never need a global change. That costs a fraction of the volume and gives cleaner output.

Finally, any incident where logging itself caused harm, a full disk, a cost spike, an outage made worse by log volume, goes through the normal blameless post-mortem, and the action items adjust the rails: a new prefix rule, a lower cap, a better default. Reviewing the tool's audit log once a quarter also shows whether people are hitting the limits often, which may mean the limits are too tight.

7Follow-up questions

Is restricting the endpoint going to slow down incident response?

Not if the tool is fast. A chat command that applies a scoped change to every pod in a few seconds is quicker than finding pod addresses and calling Actuator by hand, and it reverts itself. The second approval only applies to the rare root or framework request. Measuring the time from request to applied change keeps us honest about this.

What if a framework logger really is needed at DEBUG?

Sometimes it is, for example Hibernate's SQL logger when diagnosing a query problem. The tool allows it with a second approval, a short duration and ideally on one pod or a canary rather than all of them. Narrow framework loggers like org.hibernate.SQL can also be added to the allowed list on their own, while broad prefixes like org.springframework stay restricted.

How do you handle engineers with direct access to pods?

Treat direct pod access in production as break-glass access, logged and reviewed. With Actuator on a protected port and requiring the tool's identity, even someone who can reach a pod cannot change levels without the right token. Platform volume caps remain as the last line of defence.

8Conclusion

In this answer, we turned two root DEBUG incidents into a policy and a set of guard rails. The policy makes every runtime change owned, scoped, reasoned and time-limited. The Actuator loggers endpoint is reachable only by one audited tool, which refuses the root logger and broad framework packages without a second approval, caps level and duration and reverts automatically. The platform caps volume per service with alerts, targeted per-tenant or per-request DEBUG is the default, and post-mortems keep the rails current.

What to say in the interviewAbout 90 seconds aloud

Open with

I'd start from the fact that nobody set root to DEBUG on purpose to cause harm; the system let them. So the policy is short: runtime level changes in production go through one tool, each change has a service, logger, level, reason and end time, it's limited to the service's own packages, it's 30 minutes by default and four hours at most, and it reverts automatically.

Then, if they want more

Then the guard rails make that the only way. First, access: Actuator runs on a management port that the ingress doesn't route, and the loggers endpoint requires a token scope that only the logging tool has, so a personal call gets 403.

Second, the tool itself: it checks the logger against allowed prefixes, refuses ROOT and broad framework packages without a second approval, caps level and duration, applies the change to all pods, posts an audit record to the incident channel and reverts at expiry.

Third, the platform: per-service rate limits in the shipper, container log size limits on nodes, and alerts when a service's volume doubles, so even a bug can't fill disks or double the bill. Fourth, I'd make targeted debugging the default: the tool first asks which tenant or request, and uses an MDC filter to give DEBUG just for that.

And finally, any incident caused by logging goes through a blameless post-mortem, and we adjust the rails from what we learn.

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 official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
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 "Engineers can change log levels through Actuator in production, and twice this year...": https://scrivio-interview-library.netlify.app/java/java-logging/1feeefec65/