When an AI coding agent submits a pull request, the code often works. Tests pass. The diff looks clean. But something invisible is missing: the logging that lets you debug it at 2 AM when it breaks in production.

A new empirical study from researchers at Concordia University puts numbers behind this gap. They analyzed 4,550 agentic pull requests across 81 open-source repositories and found that AI agents handle logging differently from humans in ways that matter, and the natural language instructions we use to guide them are barely present and largely ignored.

The paper, "Do AI Coding Agents Log Like Humans? An Empirical Study" (arXiv:2604.09409), was submitted April 10, 2026. It is the first large-scale comparative analysis of logging practices between human and AI contributors in real open-source projects.

The Logging Gap

The researchers compared agentic PRs against 3,276 human PRs from the same repositories. The core finding: agents change logging less often than humans in 58.4% of repositories. When agents do touch logging, they tend to add more logs per 1,000 lines of code, about 30% more than humans. But that higher density does not mean better coverage.

Agents mimic human error-logging patterns reasonably well. Error-level logs are the easy case. The trouble starts with informational context. Agents are less consistent at matching human use of INFO-level statements. These are the logs that tell you what a system is doing during normal operation. They answer questions like "did the job start?" and "what configuration was loaded?" Without them, you have crash logs but no trail of what happened before the crash.

So agents either skip logging entirely or over-log in the wrong places. The middle ground, where experienced humans operate, is where observability actually lives.

Instructions Are Rare and Ignored

Here is where it gets worse. Only 4.7% of agentic PRs had any explicit logging instruction in the associated issue, repository instruction file, or review comments. Developers almost never tell agents to add or maintain logs.

When developers did provide logging instructions, agents complied only 33% of the time. A two-thirds failure rate. The researchers categorized instructions as either constructive (asking agents to add logs) or restrictive (asking agents to remove or modify logs). Agents failed constructive requests 67% of the time. The specificity of the instruction did not help. Vague or detailed, agents ignored them at similar rates.

This is a dual failure. Developers barely mention logging. When they do, agents mostly ignore it. Natural language, the primary interface we have for steering AI behavior, is not doing the job for this class of non-functional requirements.

Humans as Silent Janitors

The third finding might be the most consequential for engineering teams. Humans perform 72.5% of post-generation logging repairs. After an agent submits code, a human comes along and fixes the logging. This happens without explicit review feedback most of the time. No one comments on the PR saying "please add logging here." The maintainer just does it in a follow-up commit.

The paper calls these humans "silent janitors." They clean up observability issues that agents leave behind, and they do it without any paper trail in the review process. This work is invisible in standard metrics. PR acceptance rates look fine. Code review comments look clean. But someone is doing unpaid cleanup work that no one measured.

This pattern has practical consequences. If your team measures agent PRs by merge rate or review turnaround, you are missing the hidden cost. The real price of agent-generated code includes the logging repairs that happen after the merge.

Why This Matters

Logging is not a nice-to-have. It is the difference between a two-minute debug session and a two-hour one. It is the difference between "we know what happened" and "we are guessing." When agents skip logging or add the wrong kind, they are not just producing slightly different code. They are producing code that is harder to operate.

The study's authors argue that natural language instructions are insufficient for governing logging behavior. They suggest deterministic guardrails, think linters, static analysis rules, or CI checks that enforce logging standards regardless of what the agent's prompt said.

This is a reasonable conclusion. If agents ignore 67% of explicit logging instructions, adding more instructions will not solve the problem. The failure is not in the phrasing. The failure is in the mechanism. Natural language is a suggestion. A linter is a requirement.

What Engineering Teams Should Do

Based on this research, teams working with AI coding agents should take three concrete steps:

Add logging checks to CI. Do not rely on agents to include appropriate logging. Write rules that verify logging coverage for key code paths. Fail the PR if logs are missing where they should be.

Include logging requirements in agent instruction files. Even though compliance is low, 4.7% instruction coverage is still worse than it needs to be. If your repository has a CLAUDE.md or copilot-instructions.md, add explicit logging expectations. Some compliance beats none.

Track post-merge logging repairs. If maintainers are fixing logging after merges, that is a signal that your agent workflow is not catching these issues. Measure it. Make the invisible work visible.

The Bigger Picture

This study focuses on logging, but the pattern generalizes. Any non-functional requirement, security practices, error handling, documentation conventions, runs the same risk. Agents optimize for the functional outcome. Did the test pass? Does the feature work? The stuff that makes code maintainable and observable falls through the cracks.

The "silent janitor" problem is a warning sign for any team adopting AI agents at scale. If the cleanup work stays invisible, it accumulates. It becomes technical debt that no one tracks because no one measures it. The agents look productive. The code looks functional. The observability erodes.

The authors have shared a replication package so others can verify or extend their findings. The dataset comes from the AIDev corpus, covering repositories with at least 500 GitHub stars, filtered to Python, Java, and JavaScript/TypeScript projects with at least 10 agentic and 10 human PRs each. The logging detection uses regex-based identification validated at 96% precision and 94% recall on a 380-diff sample.

This is empirical work with real numbers on a real problem. The gap between what agents produce and what production systems need is measurable, and right now it is significant.


Suggested title: AI Coding Agents Don't Log Like Humans — And Asking Nicely Doesn't Fix It

Word count: 972

Citations:

  • Ouatiti, Y.E. et al. "Do AI Coding Agents Log Like Humans? An Empirical Study." arXiv:2604.09409, April 10, 2026. https://arxiv.org/abs/2604.09409
  • Li, Y. et al. AIDev dataset, 2025b.
  • Fu, Q. et al. "Where do developers log? An empirical study on logging practices." MSR 2014.
  • Yuan, D. et al. "Improving software diagnosability via log enhancement." ACM TOCS, 2012.
  • Rodriguez, M. et al. "Over-logging by LLMs." 2025.
  • Kabinna, S. et al. "Logging statement migrations." SANER, 2016.

Fact-check notes:

  • The 58.4%, 4.7%, 67%, and 72.5% figures all come directly from the paper's abstract and results sections. Verified against the arXiv HTML version.
  • The "30% more logs per 1,000 lines of code" figure comes from the paper's RQ1 findings. Verified.
  • The replication package reference (Ouatiti, 2026) is cited in the paper. I have not verified the package's availability independently.
  • The regex precision/recall (96%/94% on 380 diffs) is from Section 3.2 of the paper. Verified.
  • The study period is December 2024 to July 2026. This appears to include future dates, suggesting the AIDev dataset extends forward or the dates reflect a pre-print with an extended collection window. Flagged for review.
  • I characterized the "silent janitor" finding as happening "without explicit review feedback most of the time." The paper says "mostly implicit." This is my interpretation. Flagged for nuance check.