没有合适的资源?快使用搜索试试~ 我知道了~
首页开源软件项目中日志实践:一致性与理解挑战
开源软件项目中日志实践:一致性与理解挑战
需积分: 10 0 下载量 61 浏览量
更新于2024-09-07
收藏 826KB PDF 举报
本文主要探讨了在开源软件项目中日志记录实践的实施情况,针对软件系统运行时行为理解中的关键问题——当前的日志记录实践是否能有效地捕捉系统的动态行为。背景中提到,日志是软件在运行过程中产生的记录,对于理解系统的动态行为至关重要。开发者普遍接受在源代码中插入日志语句作为生成日志的方式。 尽管日志分析的研究众多,关于日志实践的研究相对较少,这促使研究人员质疑当前的日志策略是否能满足有效监控的目的。研究团队通过一项实证研究来探究这一问题,他们选择了28个顶级开源项目进行深入分析。研究关注了三个主要方面:日志密度(即代码中包含的日志语句数量)、日志级别(记录哪些信息)以及日志上下文(在何处插入日志语句)。 研究结果显示,不同开发者在项目内部和跨项目之间对日志密度和级别有着显著的不一致性,这意味着不同开发者的日志处理方式可能大相径庭,这可能会影响日志的完整性和可读性。然而,日志上下文的选择相对较为一致,表明开发者在决定何时记录信息方面有一定程度的共识。 这个发现暗示着,仅仅依赖于当前的日志实践来全面理解软件系统的运行行为可能存在局限性。为了提高日志的可用性和有效性,未来的研究可能需要关注如何统一和优化日志策略,以确保日志不仅数量足够,而且能够准确地反映出软件系统的各种动态行为。此外,也需要考虑日志的标准化和自动化,以便于更高效地收集、存储和分析这些关键信息,从而更好地支持故障排查、性能优化和持续改进。
资源详情
资源推荐
How is Logging Practice Implemented in Open
Source Software Projects? A Preliminary
Exploration
Guoping Rong, Shenghui Gu
†
, He Zhang, Dong Shao, Wanggen Liu
‡
State Key Laboratory of Novel Software Technology, Software Institute, Nanjing University, Nanjing, China
{ronggp, hezhang, dongshao}@nju.edu.cn,
†
dz1732002@smail.nju.edu.cn,
‡
wayne.liu@transwarp.io
Abstract—Background: Logs are the footprints that software
systems produce during runtime, which can be used to un-
derstand the dynamic behavior of these software systems. To
generate logs, logging practice is accepted by developers to
place logging statements in the source code of software systems.
Compared to the great number of studies on log analysis, the
research on logging practice is relatively scarce, which raises a
very critical question, i.e. as the original intention, can current
logging practice support capturing the behavior of software sys-
tems effectively? Aims: To answer this question, we first need to
understand how logging practices are implemented these software
projects. Method: In this paper, we carried out an empirical study
to explore the logging practice in open source software projects
so as to establish a basic understanding on how logging practice
is applied in real world software projects. The density, log level
(what to log?) and context (where to log?) are measured for our
study. Results: Based on the evidence we collected in 28 top open
source projects, we find the logging practice is adopted highly
inconsistently among different developers both across projects
and even within one project in terms of the density and log
levels of logging statements. However, the choice of what context
the logging statements to place is consistent to a fair degree.
Conclusion: Both the inconsistency in density and log level and
the convergence of context have forced us to question whether it is
a reliable means to understand the runtime behavior of software
systems via analyzing the logs produced by the current logging
practice.
Keywords—log, logging practice, empirical study, Java-based
I. INTRODUCTION
Logs are generally used to record the runtime behavior of
software systems or services. A variety of software engineer-
ing tasks with diverse purposes depend on logs, for example,
debugging, monitoring, auditing, defect prediction and so
on [1]–[5]. In particular, logs are significant for software
developers and testers to diagnose failures both in testing en-
vironment and production environment [6], [7]. Sometimes it
is the only way for software engineers to deal with production
failures. Moreover, with the rise of new technologies such as
AIOps [8] in recent years, logs play an increasing important
role to provide critical information for system operations.
To produce logs, logging practice is a software engineering
practice that software developers used to put logging state-
ments here and there in the source code they developed. The
importance of logging practice has been widely recognized
in industry [9]. Apparently, to be useful, logs generated by
logging statements in the source code should be well-formed
and informative, which requires logging practice to be carried
out properly. However, it is normally difficult to make sound
decisions to determine the context of logging statements
(where to log?) and the content of logging statements (what
to log?) [10]–[12]. For example, study [13] lists several
scenarios, with which developers should not put logging
statements. Meanwhile, the content of logging statement could
also influence its capability to capture the runtime behavior
of software systems. For example, study [14] reveals that
more than half of logging statements even do not contain
any variables. These facts may raise a critical issue, i.e. can
current logging practice provide necessary and reliable support
to produce logs for further analysis? To answer this question,
we must first understand the implementation status of the
logging practice in real software projects. To the best of
our knowledge, there are very few studies in the academic
community covering this topic. In this sense, we carry out this
empirical study to explore the logging practice in real-world
software projects. Since it is not likely to obtain the source
code of commercial software systems, we mined 100 top open
source projects on GitHub, from which we extracted logging
statements to provide the data source for our investigation.
By analyzing the logging statements, we identified obvious
inconsistence both across projects and within each project in
terms of density and log level. In addition, the placement of
the logging statements converges. These facts to a fair degree
imply that the logging practice has not been well carried out in
these projects. In view of this, we have to question whether it
is reliable and valid to capture program behavior by analyzing
the logs.
The rest of the paper is organized as follows. Section II
briefs the related work. Section III introduces the research
objective and the approach we applied. Section IV reports
the analysis results. Section V discusses the implications. The
threats to validity are also presented in this section. Finally, we
conclude this paper in Section VI with suggestions for future
work.
II. R
ELATED WORK
A. Log Analysis
In view of the importance of logs, research on this topic
attracts more and more researchers. The majority of these
researches concentrate on log analysis [15], which means
171
2018 25th Australasian Software Engineering Conference (ASWEC)
2377-5408/18/$31.00 ©2018 IEEE
DOI 10.1109/ASWEC.2018.00031
下载后可阅读完整内容,剩余9页未读,立即下载
chenfsd
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C++标准程序库:权威指南
- Java解惑:奇数判断误区与改进方法
- C++编程必读:20种设计模式详解与实战
- LM3S8962微控制器数据手册
- 51单片机C语言实战教程:从入门到精通
- Spring3.0权威指南:JavaEE6实战
- Win32多线程程序设计详解
- Lucene2.9.1开发全攻略:从环境配置到索引创建
- 内存虚拟硬盘技术:提升电脑速度的秘密武器
- Java操作数据库:保存与显示图片到数据库及页面
- ISO14001:2004环境管理体系要求详解
- ShopExV4.8二次开发详解
- 企业形象与产品推广一站式网站建设技术方案揭秘
- Shopex二次开发:触发器与控制器重定向技术详解
- FPGA开发实战指南:创新设计与进阶技巧
- ShopExV4.8二次开发入门:解决升级问题与功能扩展
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功