Quick revision
The short answer
I would set company-wide defaults in the shared logging starter (INFO for application packages and WARN for frameworks in production), give teams a safe way to raise levels temporarily with automatic expiry and an audit trail so DEBUG is never left on, and make cost visible with per-service volume dashboards, budgets and growth alerts. High-rate routine events move to metrics or are sampled, and the meaning of each level is agreed across the company so alerting and incident tooling can rely on it.
What to remember
In this answer, we tackled level drift and doubled cost as a leadership problem. We shipped default levels in the shared starter, made temporary changes easy through one audited tool with automatic expiry and per-request DEBUG as a cheaper option, made volume and cost visible per service with budgets and growth alerts, replaced high-rate per-event lines with metrics, sampling and shipper rate limits, and agreed on what each level means so that alerting and incident tooling can depend on it.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would set company-wide defaults in the shared logging starter (INFO for application packages and WARN for frameworks in production), give teams a safe way to raise levels temporarily with automatic expiry and an audit trail so DEBUG is never left on, and make cost visible with per-service volume dashboards, budgets and growth alerts. High-rate routine events move to metrics or are sampled, and the meaning of each level is agreed across the company so alerting and incident tooling can rely on it.
Why this question is asked
When log storage cost doubles in a year, the cause is rarely one big mistake. It is many reasonable local choices: one team leaves DEBUG on after an incident, another logs every request at INFO, a third logs almost nothing and then asks for DEBUG during every outage. Each choice makes sense to the team, and nobody sees the total. Interviewers ask this leadership question to see whether we can set standards that teams accept and build mechanisms that make the right behaviour the easy one. In this answer, we will look at why levels drift, set default levels in the shared starter, provide safe temporary changes, make cost visible to the teams that create it, reduce volume with metrics and sampling, and agree on what levels mean.
1Why Levels Drift Apart
Teams set levels based on their last bad experience. A team that once could not debug an incident runs DEBUG in production 'just in case'. A team that once filled a disk logs nothing below WARN. Neither is wrong about its own risk; both are missing information. The first does not see the cost, and the second does not have a cheap way to get detail when it needs it.
So the standard has to answer both concerns at once: a sensible default that keeps cost down, and a fast, safe way to get more detail during an incident. If we only publish a rule saying 'INFO in production', teams that fear losing detail will quietly ignore it.
2Defaults in the Shared Starter
Most companies at this size have, or should have, a shared Spring Boot starter that every service depends on. It is the right place for defaults, because it reaches every service with a normal dependency upgrade. The defaults I would ship are INFO for the company's own packages, WARN for frameworks and libraries, and a short list of known noisy loggers set higher still.
Notice that the starter does not forbid DEBUG. It makes DEBUG in production visible, tied to a reason and an end date. That keeps the standard honest without blocking teams that have a real need.
3Safe Temporary Changes With Expiry
Teams leave DEBUG on for months mostly because turning it on was hard and turning it off was nobody's job. So the mechanism should make temporary changes easy and reverting automatic. I would provide one tool, a small internal service or chat command, that raises a logger's level across all instances of a service through the Actuator loggers endpoint or a shared configuration source, records who did it and why, and reverts after a fixed time, for example 30 minutes by default and at most 24 hours.
For many problems, per-request or per-tenant DEBUG, enabled through an MDC-based filter, is even better: it gives detail for the failing case without raising volume for everyone.
- Engineer needs more detail
- Problem limited to one tenant or request?YesMDC-based DEBUG for that keyNoRaise logger level via the tool
- Tool records who, what, whyposted to the incident channel
- Automatic revert30 minutes default, 24 hours maximum
4 steps in order. Play them, or step through them one at a time.
4Make Cost Visible to the Teams That Create It
Cost doubled partly because nobody saw it per team. A dashboard showing each service's daily log volume in gigabytes, its share of the bill and its trend changes conversations immediately. If one service writes 400 GB a day and the next largest writes 40, that team will usually fix it within a sprint once it sees the number.
Then I would add budgets: each service gets an expected daily volume, agreed with its team, and an alert fires on sudden growth, for example more than double the seven-day average. Some companies go further and charge log cost back to teams' budgets. That is effective, but I would start with visibility and budgets, because chargeback without tools to reduce volume just creates resentment.
| Source | Share of volume | Change |
|---|---|---|
| DEBUG left on in 6 services | 38% | expire via the tool |
| Per-request INFO lines at high rate | 27% | replace with metrics |
| Noisy framework loggers | 14% | raise in starter defaults |
| Repeated stack traces | 9% | log once where handled |
| Everything else | 12% | keep |
5Sampling, Rate Limits and Metrics Instead of Lines
Some high-rate events are useful in aggregate but not individually. An INFO line per HTTP request at 3,000 requests per second is 260 million lines a day, and almost all of them say 'it worked'. Micrometer metrics give us rate, latency and errors for those requests at a tiny fraction of the cost, and tracing with sampling gives the per-request detail for a sample. Where individual lines are still wanted, sampling one in a hundred successful requests, while keeping all failures, preserves the picture.
Rate limits in the shipper, per service, act as a safety net: if a service suddenly writes ten times its budget, the excess is dropped or sampled with a counter, and the owning team is alerted.
6Agree on the Meaning of Levels
Finally, the standard needs a shared meaning of levels, because the platform will build on it. If ERROR always means 'the service failed to do its job', incident tooling can link error spikes to deployments, and alerting can treat a rise in ERROR rate as meaningful. I would write a one-page definition with examples from our own systems, review it with a few respected engineers from different teams before publishing, and include it in code review checklists and onboarding.
7Follow-up questions
How would you handle a team that says DEBUG in production is needed for compliance?
I would ask which requirement and which events. Compliance rules almost always require specific records, such as who accessed or changed what, kept for a defined time with integrity guarantees. DEBUG logs are a poor way to meet that: they can be switched off, they are mixed with noise and they often contain data that should not be retained. So I would work with the team and the compliance owner to identify those events, record them as audit events through a dedicated path with the right retention, and then return the operational logs to INFO. The cost saving often pays for the audit work.
What if a team pushes back on the defaults?
The defaults are only a starting point; teams can override specific loggers with a reason and an end date. If a team has a real need that the defaults do not meet, that is useful feedback and maybe a sign the starter needs a new option. What I would not accept is permanent DEBUG without a reason, because its cost lands on everyone.
How do you measure that the standards worked?
Track total log volume and cost per month, the number of services with DEBUG or TRACE in production, the number of temporary changes made through the tool and how many expired automatically, and the ERROR volume per service. A good outcome in the first two quarters is volume back near the previous year's level while incident investigation time does not get worse.
8Conclusion
In this answer, we tackled level drift and doubled cost as a leadership problem. We shipped default levels in the shared starter, made temporary changes easy through one audited tool with automatic expiry and per-request DEBUG as a cheaper option, made volume and cost visible per service with budgets and growth alerts, replaced high-rate per-event lines with metrics, sampling and shipper rate limits, and agreed on what each level means so that alerting and incident tooling can depend on it.
Open with
I'd treat this as two problems: teams don't see the cost, and teams don't have a safe way to get detail when they need it, so they keep DEBUG on just in case.
Then, if they want more
First, defaults: our shared starter would set INFO for our own packages and WARN for frameworks in production, and report at start-up any logger running at DEBUG with its reason and end date.
Second, a safe way to raise levels: one tool that changes a logger's level across all instances, records who, what and why, posts it to the incident channel, and reverts automatically after 30 minutes by default. For many cases I'd point teams to per-tenant or per-request DEBUG through an MDC filter instead, which gives detail without raising volume for everyone.
Third, visibility: a dashboard of log volume and cost per service, a budget per service and an alert when volume doubles against the weekly average. Usually a few services account for most of the growth, and teams fix it once they see it.
Fourth, less volume by design: high-rate per-request INFO lines become metrics, routine events are sampled, and the shipper rate-limits per service as a safety net. And finally, a one-page agreed meaning of levels, reviewed with engineers from several teams, because alerting and incident tooling depend on ERROR meaning the same thing everywhere.
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 "You lead platform engineering. Teams set log levels in very different ways: some run...": https://scrivio-interview-library.netlify.app/java/java-logging/3b358698b4/