DeepLV: Suggesting Log Levels Using Ordinal Based Neural Networks
Zhenhao Li, Heng Li, Tse-Hsun Peter Chen, Weiyi Shang
Abstract
Developers write logging statements to generate logs that provide valuable runtime information for debugging and maintenance of software systems. Log level is an important component of a logging statement, which enables developers to control the information to be generated at system runtime. However, due to the complexity of software systems and their runtime behaviors, deciding a proper log level for a logging statement is a challenging task. For example, choosing a higher level (e.g., error) for a trivial event may confuse end users and increase system maintenance overhead, while choosing a lower level (e.g., trace) for a critical event may prevent the important execution information to be conveyed opportunely. In this paper, we tackle the challenge by first conducting a preliminary manual study on the characteristics of log levels. We find that the syntactic context of the logging statement and the message to be logged might be related to the decision of log levels, and log levels that are further apart in order (e.g., trace and error) tend to have more differences in their characteristics. Based on this, we then propose a deep-learning based approach that can leverage the ordinal nature of log levels to make suggestions on choosing log levels, by using the syntactic context and message features of the logging statements extracted from the source code. Through an evaluation on nine large-scale open source projects, we find that: 1) our approach outperforms the state-of-the-art baseline approaches; 2) we can further improve the performance of our approach by enlarging the training data obtained from other systems; 3) our approach also achieves promising results on cross-system suggestions that are even better than the baseline approaches on within-system suggestions. Our study highlights the potentials in suggesting log levels to help developers make informed logging decisions.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext e4b4dc7f-d30e-474f-bc8d-6a6fd7bea0bcCited by top-tier papers17
- Using Deep Learning to Generate Complete Log StatementsAntonio Mastropaolo, Luca Pascarella, Gabriele BavotaICSE 2022 · 60 citations
- Deep Learning or Classical Machine Learning? An Empirical Study on Log-Based Anomaly DetectionBoxi Yu, Jiayi Yao, Qiuai Fu, Zhiqing Zhong et al.ICSE 2024 · 49 citations
- Did We Miss Something Important? Studying and Exploring Variable-Aware Log AbstractionZhenhao Li, Chuan Luo, Tse-Hsun Chen, Weiyi Shang et al.ICSE 2023 · 41 citations
- Code Search is All You Need? Improving Code Suggestions with Code SearchJunkai Chen, Xing Hu, Zhenhao Li, Cuiyun Gao et al.ICSE 2024 · 31 citations
- TeLL: log level suggestions via modeling multi-level code block informationJiahao Liu, Jun Zeng, Xiang Wang, Kaihang Ji et al.ISSTA 2022 · 20 citations
Builds on1
Related papers
- Are They All Good? Studying Practitioners' Expectations on the Readability of Log MessagesZhenhao Li, An Ran Chen, Xing Hu, Xin Xia et al.ASE 2023 · 6 citations
- UniLog: Automatic Logging via LLM and In-Context LearningJunjielong Xu, Ziang Cui, Yuan Zhao, Xu Zhang et al.ICSE 2024 · 56 citations
- How Do Developers' Profiles and Experiences Influence their Logging Practices? An Empirical Study of Industrial PractitionersGuoping Rong, Shenghui Gu, Haifeng Shen, He Zhang et al.ICSE 2023 · 4 citations
- On the Temporal Relations between Logging and CodeZishuo Ding, Yiming Tang, Yang Li, Heng Li et al.ICSE 2023 · 9 citations
- Go Static: Contextualized Logging Statement GenerationYichen Li, Yintong Huo, Renyi Zhong, Zhihan Jiang et al.FSE 2024 · 17 citations
