Quick revision
The short answer
I would make the target one event schema, not one transport: containers write structured JSON to stdout and a node-level shipper collects it, while the VMs keep writing rotated files that the same shipper tails, so the central store sees identical events from both worlds. Then I would migrate in waves ordered by risk and value, run old and new paths in parallel for each wave, and finish by retiring the legacy agents and custom parsers.
What to remember
In this answer, we saw that the single logging model should be defined as one schema and one shipper, with stdout for containers and capped rolling files for VMs, rather than forcing every application onto Kubernetes. We ordered the work by risk and value, kept files where they act as a useful buffer, protected each wave with a time-boxed parallel run that compares counts and alerts, and treated retiring the legacy agents and parsers as the real finish line.
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 make the target one event schema, not one transport: containers write structured JSON to stdout and a node-level shipper collects it, while the VMs keep writing rotated files that the same shipper tails, so the central store sees identical events from both worlds. Then I would migrate in waves ordered by risk and value, run old and new paths in parallel for each wave, and finish by retiring the legacy agents and custom parsers.
Why this question is asked
A three-year logging migration across a hundred applications is not a logging problem so much as a change-management problem. Every dashboard, alert and incident runbook in the company quietly depends on the shape of today's logs, so a careless move breaks things people only notice during an outage. Interviewers ask this at the most senior level to see whether we can set a target that both old and new systems can reach, sequence the work so it pays off early, and name the risks before they happen. In this answer, we will define the target model, see why the VMs do not need to look like Kubernetes to join it, decide which applications go first, handle the cases where files must stay, and walk through the risks and how a parallel run protects against them.
1Where We Start: Two Logging Worlds
On the virtual machines, each Java application writes to a rolling file through Logback or Log4j2. A rolling file is a log file that the logging library closes and renames when it reaches a size or a date boundary, for example app.log becoming app-2026-11-04.1.log.gz, and old files are deleted after a retention period. Over the years each team picked its own pattern layout, its own rotation rules and often its own agent to ship the files, so there are probably five or six line formats and several custom parsers in the central store.
On Kubernetes, new services write to standard output. The container runtime stores that output in files on the node, and a shipper running once per node (a DaemonSet such as Fluent Bit, Vector or the OpenTelemetry Collector) reads those files and sends them on. The application never deals with rotation; the node does.
The mistake would be to treat these as two migrations. What the business actually needs is one way of searching, alerting and retaining logs. So the real goal is that an event from a 2012 VM application and an event from a 2026 pod look the same once they arrive.
2Choosing the Target: One Schema, Two Collection Paths
The target I would set has three parts. First, a single structured schema, JSON with agreed field names such as timestamp, level, service.name, service.version, environment, trace.id, logger and message. Using an existing convention like Elastic Common Schema or OpenTelemetry semantic conventions saves us from inventing names and arguing about them. Second, one shipper technology everywhere, configured from a shared template. Third, one central store with one set of index and retention rules.
Notice that the VMs do not have to move to stdout to join. The same shipper can tail rotated files on a VM just as it tails container log files on a node. The application only has to change its encoder from a plain pattern to the shared JSON encoder, which in a Spring Boot application is often one dependency and a few lines of configuration. That is the reason this target is reachable in three years: we change formats everywhere, but we only change platforms when the application moves to Kubernetes for its own reasons.
- ApplicationsShared starter: JSON encoder, common fields, levels
- Local outputPods: stdout. VMs: rotated JSON file with fixed caps
- ShipperOne technology, one template; tails stdout files and VM files
- PipelineParsing removed, light enrichment, masking, rate limits
- Central storeOne schema, one set of dashboards, alerts and retention
5 layers, from the top down. Step through them one at a time.
Both worlds differ only in the second layer; everything above and below is shared.
3Deciding What Moves First
With a hundred applications we cannot do everything at once, and the order matters more than the speed. I would score each application on risk and value. Risk includes past disk-full incidents caused by logs, applications with compliance or audit needs, and applications whose custom parser breaks often. Value includes support load: the applications the on-call team searches every week benefit most from a clean schema.
A simple inventory spreadsheet is enough to start: application, owner, logging library and version, current format, shipper, daily volume, incidents linked to logging in the last year, and compliance tags. From that I would build waves of about ten to fifteen applications each quarter. The first wave should include two or three friendly, well-tested services so the playbook is proven before we touch the risky ones. So over twelve quarters we have room for the hundred applications plus a buffer for the awkward ones.
But there is a catch. The highest-risk applications are usually also the oldest and least tested. For those I would budget extra time and pair a platform engineer with the owning team rather than handing over a document.
4Keeping Files Where They Earn Their Place
Some applications should keep writing files even in the end state. A VM in a branch office with an unreliable network, a batch job that must not lose logs while the shipper is down, or a system with a regulatory requirement for local copies all have good reasons. A file is a buffer: if the network fails for two hours, the shipper resumes from its saved position once it comes back.
What we standardise is the rotation, not the existence of the file. Every file-writing application gets the same rolling policy from the shared configuration, with a size cap per file and a total size cap, so a log storm can no longer fill the disk.
With totalSizeCap set, the worst a runaway application can do is use 5 GB, and the shipper has a week of local history to catch up from after an outage.
5The Risks and How a Parallel Run Handles Them
The first risk is losing logs during cutover. If we switch an application from the old agent to the new shipper on a Tuesday afternoon and the new path has a misconfigured file path, we have a silent gap. The second is broken alerts: an alert that matches the text 'Payment failed' in a plain line may not match once the message sits in a JSON field, and nobody notices until a real payment outage goes unalerted. The third is cost: during migration we may ship the same logs twice, and some vendors charge per gigabyte ingested, so a careless wave can double a bill.
The answer to all three is a time-boxed parallel run per wave. For two to four weeks the application writes the new format and both shippers run, the old one feeding the old index and the new one feeding the new index. During that time we compare event counts per hour between the two paths, replay each alert and saved search against the new index, and only then cut over. To control cost, the parallel run is limited in time and, for very high-volume applications, we can sample the duplicate path rather than sending all of it.
- Inventory and score the waveowners, volume, alerts, parsers
- Switch encoder to shared JSONshipped through the shared starter
- Run old and new paths in paralleltwo to four weeks
- Counts and alerts match?YesCut over and stop the old agentNoFix the mapping and keep both
- Delete old parser and index rulestracked per application
5 steps in order. Play them, or step through them one at a time.
6Tracking Progress and Finishing the Job
Migrations of this length usually fail at the end, not the start. Eighty applications move, the last twenty linger, and the company pays forever for two pipelines. So I would publish a simple progress view per application: format migrated, new shipper active, parallel run complete, legacy agent removed, custom parser deleted. Leadership sees the number of legacy agents and parsers going down each quarter, which is the real measure of done.
The final step of each wave, and of the whole programme, is retirement: uninstalling the old agents from the VMs, deleting the custom parsing rules, and removing the old indexes once their retention runs out. I would plan the last two quarters specifically for the long tail, with an agreed deadline after which the old pipeline is switched off and the remaining owners know it.
7Follow-up questions
Why not simply move every VM application to Kubernetes first?
Because that couples a logging change to a much larger platform migration that has its own timeline, budget and risks. Many of those applications may never move, or will move in year five. By making the schema the target and letting the shipper read files, the logging benefits arrive in year one for everybody, and when an application does move to Kubernetes, only its output changes from a file to stdout.
How do you prove that no logs were lost during the parallel run?
Count events per application per hour on both paths and compare them. Small differences come from timing at hour boundaries; a steady gap of a few percent means the new shipper is dropping lines, often because of multi-line stack traces or a missing rotated file. We can also emit a synthetic heartbeat line every minute from each application and check that every heartbeat arrives in the new index.
What do you do with an application nobody owns?
Assign an owner before it enters a wave, even if that is the platform team temporarily. An unowned application is exactly the one that fills a disk at night. If nobody will take it, that is a signal to talk to leadership about retiring it, which is often cheaper than migrating it.
8Conclusion
In this answer, we saw that the single logging model should be defined as one schema and one shipper, with stdout for containers and capped rolling files for VMs, rather than forcing every application onto Kubernetes. We ordered the work by risk and value, kept files where they act as a useful buffer, protected each wave with a time-boxed parallel run that compares counts and alerts, and treated retiring the legacy agents and parsers as the real finish line.
Open with
I would define the target as one event schema rather than one platform. New services already log structured JSON to stdout, collected by a node shipper. For the hundred VM applications, I would switch their encoder to the same JSON format through a shared starter and have the same shipper tail their rotated files, so the central store sees identical events from both.
Then, if they want more
Then I would inventory every application with its owner, volume, format, agent and logging incidents, and plan waves of ten to fifteen per quarter, starting with a couple of friendly services to prove the playbook, then the ones with disk-full incidents, compliance needs or heavy support load.
I would keep files where they make sense, for example on sites with unreliable networks, but standardise rotation with size and total caps. The risks I would manage are lost logs at cutover, alerts that stop matching when the format changes, and cost spikes from shipping twice.
Each wave gets a parallel run of a few weeks where both paths run, we compare hourly counts and replay alerts on the new index, and only then cut over. I would track progress per application and treat removing the old agents and custom parsers as the final step, because that is when we actually stop paying for two systems.
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 "Your company still runs about a hundred Java applications on virtual machines that write...": https://scrivio-interview-library.netlify.app/java/java-logging/9795ce2622/