一句话:LogImprover 用 LLM 把日志改进从被动插入转为主动发现缺口并生成整体日志补丁,实际部署接受率达 68.12%。
高质量日志对云服务可靠性至关重要,但工业界的日志改进流程多为人工、被动且难以扩展;现有自动化工具继承了这种被动性,既不回答“是否该打日志”这一关键问题,也局限于简单的日志语句插入,只能覆盖真实改进需求的一小部分。为应对大规模代码库中的日志债,作者提出 LogImprover:一个由大语言模型驱动的日志质量改进框架,实现两个范式转变——从被动生成转向主动发现,从简单插入转向整体日志补丁生成。它先依据从工业最佳实践提炼的原则识别潜在日志缺口,再用级联且结构感知的 RAG 模块为每个候选补充上下文依据,随后通过分析调用栈中的日志职责与隐式 logger 继承来剪除误报,最终生成可解释、符合真实开发实践的整体补丁。评估提供双重验证:在闭世界实验中显著优于当前最优基线,并在真实部署中获得 68.12% 的开发者接受率,表明自动化日志质量改进全流程(从发现到推荐)具有实际价值。
High-quality logging is critical for the reliability of cloud services, yet the industrial process for improving it is typically manual, reactive, and unscalable. Existing automated tools inherit this reactive nature, failing to answer the crucial whether-to-log question and are constrained to simple logging statement insertion, thus addressing only a fraction of the real-world logging improvement.To address these gaps and cope with logging debt in large-scale codebases, we propose LogImprover, a framework powered by Large Language Models (LLMs) that automates proactive logging quality improvement. LogImprover introduces two paradigm shifts: from reactive generation to proactive discovery, and from simple insertion to holistic logging patch generation. First, it identifies potential logging gaps based on principles distilled from industrial best practices. Then, it grounds each candidate through a cascading, structure-aware RAG module. Next, it prunes false positives by analyzing call-stack logging responsibilities and implicit logger inheritance. Finally, it generates holistic and explainable logging patches that reflect real-world development practices.Our evaluation provides dual confirmation of its effectiveness: LogImprover significantly outperforms state-of-the-art base-lines in closed-world experiments and achieves 68.12% developer acceptance rate in its real-world deployment. This success demonstrates the practical value of automating the entire logging quality improvement lifecycle, from discovery to recommendation.
DOI 原文 ·
@inproceedings{paperbot9506,
title = {Automated Proactive Logging Quality Improvement for Large-Scale Codebases},
author = {Yichen Li and Jinyang Liu and Junsong Pu and Zhihan Jiang and Zhuangbin Chen and Xiao He and Tieying Zhang and Jianjun Chen and Yi Li and Rui Shi and Michael R. Lyu},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00283}
}