LogGen: Integrating traditional model and LLM with code analysis for precise log generation

IF 3.8 2区 计算机科学 Q1 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Journal of Systems and Software Pub Date : 2026-06-01 Epub Date: 2026-02-06 DOI:10.1016/j.jss.2026.112816
Min Li , Gou Tan , Pengfei Chen , Chuanfu Zhang
{"title":"LogGen: Integrating traditional model and LLM with code analysis for precise log generation","authors":"Min Li ,&nbsp;Gou Tan ,&nbsp;Pengfei Chen ,&nbsp;Chuanfu Zhang","doi":"10.1016/j.jss.2026.112816","DOIUrl":null,"url":null,"abstract":"<div><div>Logging is a crucial method for the runtime monitoring and measurement of program states. However, in large-scale projects, variations in developer experience lead to significant differences in the key information within log statements, making it challenging to maintain uniform log formats. Therefore, we propose <em>LogGen</em>, a log generation framework that combines a traditional model with Large Language Models (LLMs). It learns from existing projects and automatically inserts log statements into new code, addressing the challenge of LLMs struggling to pinpoint accurate log positions. By leveraging LLM code summarization and integrating function-level semantic information, <em>LogGen</em> constructs more robust features, enabling the traditional model to achieve high accuracy in log positioning. Additionally, <em>LogGen</em> extracts log styles and function call chains from projects to create a knowledge database. LLMs can produce more precise log statements by combining our knowledge with the Retrieval-Augmented Generation (RAG) framework. We evaluate <em>LogGen</em> on long-term developed Java and C++ projects, showing that it surpasses the state-of-the-art log generation methods by 41.6% in F1 of log position and 36.2% in text BLEU-4 score, exhibiting stronger robustness against code and knowledge changes.</div></div>","PeriodicalId":51099,"journal":{"name":"Journal of Systems and Software","volume":"236 ","pages":"Article 112816"},"PeriodicalIF":3.8000,"publicationDate":"2026-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Systems and Software","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0164121226000506","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2026/2/6 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

Abstract

Logging is a crucial method for the runtime monitoring and measurement of program states. However, in large-scale projects, variations in developer experience lead to significant differences in the key information within log statements, making it challenging to maintain uniform log formats. Therefore, we propose LogGen, a log generation framework that combines a traditional model with Large Language Models (LLMs). It learns from existing projects and automatically inserts log statements into new code, addressing the challenge of LLMs struggling to pinpoint accurate log positions. By leveraging LLM code summarization and integrating function-level semantic information, LogGen constructs more robust features, enabling the traditional model to achieve high accuracy in log positioning. Additionally, LogGen extracts log styles and function call chains from projects to create a knowledge database. LLMs can produce more precise log statements by combining our knowledge with the Retrieval-Augmented Generation (RAG) framework. We evaluate LogGen on long-term developed Java and C++ projects, showing that it surpasses the state-of-the-art log generation methods by 41.6% in F1 of log position and 36.2% in text BLEU-4 score, exhibiting stronger robustness against code and knowledge changes.
LogGen:将传统模型和LLM与代码分析相结合,实现精确的日志生成
日志记录是运行时监视和测量程序状态的关键方法。然而,在大型项目中,开发人员经验的差异会导致日志语句中关键信息的显著差异,从而使维护统一的日志格式变得具有挑战性。因此,我们提出了LogGen,这是一个将传统模型与大型语言模型(llm)相结合的日志生成框架。它从现有项目中学习,并自动将日志语句插入到新代码中,解决了llm难以精确定位日志位置的挑战。通过利用LLM代码汇总和集成函数级语义信息,LogGen构建了更加鲁棒的特征,使传统模型能够在日志定位中达到较高的精度。此外,LogGen从项目中提取日志样式和函数调用链,以创建知识库。llm通过将我们的知识与检索增强生成(retrieve - augmented Generation, RAG)框架相结合,可以生成更精确的日志语句。我们在长期开发的Java和c++项目中对LogGen进行了评估,结果表明,LogGen在日志位置F1和文本BLEU-4分数上分别比最先进的日志生成方法高出41.6%和36.2%,对代码和知识变化表现出更强的鲁棒性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Journal of Systems and Software
Journal of Systems and Software 工程技术-计算机:理论方法
CiteScore
8.60
自引率
5.70%
发文量
193
审稿时长
16 weeks
期刊介绍: The Journal of Systems and Software publishes papers covering all aspects of software engineering and related hardware-software-systems issues. All articles should include a validation of the idea presented, e.g. through case studies, experiments, or systematic comparisons with other approaches already in practice. Topics of interest include, but are not limited to: •Methods and tools for, and empirical studies on, software requirements, design, architecture, verification and validation, maintenance and evolution •Agile, model-driven, service-oriented, open source and global software development •Approaches for mobile, multiprocessing, real-time, distributed, cloud-based, dependable and virtualized systems •Human factors and management concerns of software development •Data management and big data issues of software systems •Metrics and evaluation, data mining of software development resources •Business and economic aspects of software development processes The journal welcomes state-of-the-art surveys and reports of practical experience for all of these topics.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书