Log statements capture critical information for software maintenance activities such as testing, debugging, and failure analysis. Because of this importance, developers must carefully design log statements, which requires significant effort. To support developers, various end-to-end automated log statement generation approaches have been proposed, whereas these approaches have mainly been evaluated within a single programming language environment and their effectiveness in multilingual environments remains underexplored. In this paper, we therefore comparatively evaluate three state-of-the-art log statement generation approaches and five large language models (LLMs) across multiple programming languages. For this purpose, we constructed a multilingual benchmark comprising 150,000 instances across five programming languages. Our empirical results demonstrate that UniLog, a state-of-the-art approach, achieves the best overall performance, maintaining high effectiveness even in multilingual environments. We also observe substantial variance in the difficulty of log generation across languages: Python presents a greater challenge, whereas JavaScript yields comparatively better performance. Detailed analysis reveals that these disparities stem from variations in log insertion distributions and language-specific logging idioms. Our findings indicate that simply scaling model size or the volume of training data is insufficient for multilingual log generation; rather, designing approaches tailored to the specific characteristics of target languages is crucial. These findings suggest that future automated logging techniques should explicitly account for language-specific logging characteristics to achieve robust performance in multilingual software development environments.
翻译:日志语句捕获了软件维护活动中(如测试、调试和故障分析)的关键信息。由于这一重要性,开发人员必须精心设计日志语句,这需要付出巨大的努力。为了支持开发人员,已提出了多种端到端的自动化日志语句生成方法,然而这些方法主要在单一编程语言环境中得到评估,其在多语言环境下的有效性仍未得到充分探索。因此,本文对三种最先进的日志语句生成方法和五种大型语言模型在多种编程语言上进行了比较评估。为此,我们构建了一个包含五种编程语言、共计150,000个实例的多语言基准测试集。我们的实证结果表明,最先进的方法UniLog取得了最佳的整体性能,即使在多语言环境下也能保持高有效性。我们还观察到不同语言之间日志生成难度的显著差异:Python语言构成了更大的挑战,而JavaScript则取得了相对更好的性能。详细分析揭示,这些差异源于日志插入分布和特定语言的日志习惯用语的变化。我们的研究结果表明,单纯扩大模型规模或训练数据量不足以应对多语言日志生成;相反,设计针对目标语言特定特性的方法至关重要。这些发现提示,未来的自动化日志记录技术应明确考虑语言特定的日志特性,以便在多语言软件开发环境中实现稳健的性能。