arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.17529cs.SE
收藏

单语言证据不足以支持自动化日志记录:一个多语言基准和基于LLM的实证研究

Automated Logging Is Language-Sensitive: A Multilingual Benchmark and Empirical Study of LLMs

The Chinese University of Hong Kong(香港中文大学);Singapore Management University(新加坡管理大学)

Renyi Zhong, Yichen Li, Yulun Wu, Jinxi Kuang, Yintong Huo, Michael R. Lyu

AI总结:

本文通过多语言基准MultiLogBench研究自动化日志记录的跨语言有效性,发现框架锚点匹配是最敏感的组件,模型排名在顶级稳定,但需多语言验证以确保鲁棒性。

摘要:

日志语句对调试、故障诊断和生产可观测性至关重要,但编写需要开发者决定日志位置、API和严重级别及暴露的运行时信息。自动化日志旨在减轻此负担,但现有证据仍以Java为中心的仓库快照数据集为主。本文提出MultiLogBench,涵盖六个编程语言生态系统,包含63965个生产代码仓库快照实例、744个维护期间引入日志语句的修订历史案例及配对转换的修订历史分支用于鲁棒性分析。使用七个现代大语言模型在统一协议下评估日志位置本地化、框架锚点匹配、严重性预测、消息生成、变量恢复及级联整体质量。结果表明存在明显的跨语言差异:框架锚点匹配是最敏感的组件,循环和嵌套可调用位置是最难的结构上下文,且模型排名仅在顶级稳定。这些模式在修订历史数据的粗粒度层面持续存在,而转换输入不会导致广泛相同方向的性能崩溃。总体而言,MultiLogBench表明,关于自动化日志的稳健结论需要多语言评估和维护导向的验证。

英文摘要:

Logging statements are central to debugging, failure diagnosis, and production observability, yet writing them requires developers to decide where to place a logging statement, which API and severity level to use, and what runtime information to expose. Automated logging aims to reduce this burden, but existing evidence remains dominated by Java-centric repository-snapshot dataset. It is therefore unclear whether conclusions about model behavior and model selection generalize across programming-language ecosystems or realistic code evolution. This paper presents MultiLogBench, a multilingual benchmark and empirical study spanning six programming language ecosystems. MultiLogBench contains 63,965 production-code repository-snapshot instances, 744 revision-history cases where developers introduce logging statements during maintenance, and a paired transformed revision-history branch for robustness analysis. Using seven contemporary large language models under a unified protocol, we evaluate logging-site localization, framework-anchor matching, severity prediction, message generation, variable recovery, and cascaded overall quality. Results show clear cross-language variation: framework-anchor matching is the most language-sensitive component, loop and nested-callable sites are the hardest structural contexts, and model rankings are stable only at the top tier. These patterns persist at a coarse level on revision-history data, while transformed inputs do not cause a broad same-direction performance collapse. Overall, MultiLogBench shows that robust claims about automated logging require multilingual evaluation and maintenance-oriented validation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑