Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3524610.3527906acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

QuLog: data-driven approach for log instruction quality assessment

Published: 20 October 2022 Publication History

Abstract

In the current IT world, developers write code while system operators run the code mostly as a black box. The connection between both worlds is typically established with log messages: the developer provides hints to the (unknown) operator, where the cause of an occurred issue is, and vice versa, the operator can report bugs during operation. To fulfil this purpose, developers write log instructions that are structured text commonly composed of a log level (e.g., "info", "error"), static text ("IP {} cannot be reached"), and dynamic variables (e.g. IP {}). However, opposed to well-adopted coding practices, there are no widely adopted guidelines on how to write log instructions with good quality properties. For example, a developer may assign a high log level (e.g., "error") for a trivial event that can confuse the operator and increase maintenance costs. Or the static text can be insufficient to hint at a specific issue. In this paper, we address the problem of log quality assessment and provide the first step towards its automation. We start with an in-depth analysis of quality log instruction properties in nine software systems and identify two quality properties: 1) correct log level assignment assessing the correctness of the log level, and 2) sufficient linguistic structure assessing the minimal richness of the static text necessary for verbose event description. Based on these findings, we developed a data-driven approach that adapts deep learning methods for each of the two properties. An extensive evaluation on large-scale open-source systems shows that our approach correctly assesses log level assignments with an accuracy of 0.88, and the sufficient linguistic structure with an F1 score of 0.99, outperforming the baselines. Our study highlights the potential of the data-driven methods in assessing log instructions quality.

References

[1]
Titus Barik, Robert DeLine, Steven Drucker, and Danyel Fisher. 2016. The Bones of the System: A Case Study of Logging and Telemetry at Microsoft. In 2016 IEEE/ACM 38th International Conference on Software Engineering Companion (ICSE-C). Association for Computing Machinery, New York, NY, USA, 92--101.
[2]
Jasmin Bogatinovski. 2022. QuLog: Github repo link. GitHub. Retrieved January 02, 2022 from https://github.com/qulog/QuLog
[3]
Leo Breiman. 2001. Random Forests. Machine Learning 45, 1 (2001), 5--32.
[4]
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language Models are Few-Shot Learners. In Advances in Neural Information Processing Systems, Vol. 33. Curran Associates, Inc., 1877--1901.
[5]
Jeanderson Cândido, Haesen Jan, Maurício Aniche, and Arie van Deursen. 2021. An Exploratory Study of Log Placement Recommendation in an Enterprise System. In 2021 IEEE/ACM 18th International Conference on Mining Software Repositories (MSR). IEEE Computer Society, Los Alamitos, CA, USA, 143--154.
[6]
Boyuan Chen and Zhen Ming (Jack) Jiang. 2017. Characterizing logging practices in Java-based open source software projects - a replication study in Apache Software Foundation. Empirical Software Engineering 22 (2017), 330--374.
[7]
Boyuan Chen and Zhen Ming Jiang. 2019. Extracting and Studying the Logging-Code-Issue- Introducing Changes in Java-Based Large-Scale Open Source Software Systems. Empirical Softw. Engg. 24 (2019), 2285--2322.
[8]
Tse-Hsun Chen, Stephen W. Thomas, and Ahmed E. Hassan. 2016. A Survey on the Use of Topic Models When Mining Software Repositories. Empirical Softw. Engg. 21 (2016), 1843--1919.
[9]
Marcello Cinque, Domenico Cotroneo, and Antonio Pecchia. 2013. Event Logs for the Analysis of Software Failures: A Rule-Based Approach. IEEE Transactions on Software Engineering 39 (2013), 806--821.
[10]
Corinna Cortes and Vladimir Vapnik. 1995. Support-vector networks. Machine Learning 20 (1995), 273--297.
[11]
Thomas M. Cover and Joy A. Thomas. 2006. Elements of Information Theory (Wiley Series in Telecommunications and Signal Processing). Wiley-Interscience, USA.
[12]
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding., 4171--4186 pages.
[13]
Rui Ding, Hucheng Zhou, Jian-Guang Lou, Hongyu Zhang, Qingwei Lin, Qiang Fu, Dongmei Zhang, and Tao Xie. 2015. Log2: A Cost-Aware Logging Mechanism for Performance Diagnosis. In Proceedings of the 2015 USENIX Conference on Usenix Annual Technical Conference. USENIX Association, USA, 139--150.
[14]
Edward Finegan. 2014. Language: Its structure and use (7 ed.). Cengage Learning, Florence, AL. 289 pages.
[15]
The Apache Software Foundation. 2022. Logging Service Project. Appache. Retrieved January 2, 2022 from https://logging.apache.org/
[16]
Qiang Fu, Jieming Zhu, Wenlu Hu, Jian-Guang Lou, Rui Ding, Qingwei Lin, Dongmei Zhang, and Tao Xie. 2014. Where Do Developers Log? An Empirical Study on Logging Practices in Industry. In Companion Proceedings of the 36th International Conference on Software Engineering. Association for Computing Machinery, New York, NY, USA, 24--33.
[17]
Eva Gibaja and Sebastián Ventura. 2015. A Tutorial on Multilabel Learning. Comput. Surveys 47, 3 (2015), 52:1--52:38.
[18]
Anu Han, Chen Jie, Shi Wenchang, Hou Jianwei, Liang Bin, and Qin Bo. 2019. An Approach to Recommendation of Verbosity Log Levels Based on Logging Intention. In 2019 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, New York, USA, 125--134.
[19]
Robert J. Hand, David J. and Till. 2001. A Simple Generalisation of the Area Under the ROC Curve for Multiple Class Classification Problems. Machine Learning 45 (2001), 171--186.
[20]
Ahmed E. Hassan. 2009. Predicting faults using the complexity of code changes. In 2009 IEEE 31st International Conference on Software Engineering. IEEE Computer Society, USA, 78--88.
[21]
Mehran Hassani, Weiyi Shang, Emad Shihab, and Nikolaos Tsantalis. 2018. Studying and Detecting Log-Related Issues. Empirical Softw. Engg. 23 (2018), 3248--3280.
[22]
Pinjia He, Zhuangbin Chen, Shilin He, and Michael R. Lyu. 2018. Characterizing the Natural Language Descriptions in Software Logging Statements. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering. Association for Computing Machinery, New York, NY, USA, 178--189.
[23]
Matthew Honnibal, Ines Montani, Sofie Van Landeghem, and Adriane Boyd. 2020. spaCy: Industrial-strength Natural Language Processing in Python. Explosion.ai.
[24]
Thorsten Joachims. 2005. A Support Vector Method for Multivariate Performance Measures. In Proceedings of the 22nd International Conference on Machine Learning. Association for Computing Machinery, New York, NY, USA, 377--384.
[25]
Suhas Kabinna, Cor-Paul Bezemer, Weiyi Shang, Mark D. Syer, and Ahmed E. Hassan. 2018. Examining the Stability of Logging Statements. Empirical Software Engineering 23 (2018), 290--333.
[26]
Diederik P. Kingma and Jimmy Ba. 2015. Adam: A Method for Stochastic Optimization.
[27]
Heng Li, Tse-Hsun (Peter) Chen, Weiyi Shang, and Ahmed E. Hassan. 2018. Studying Software Logging Using Topic Models. Empirical Softw. Engg. 23 (2018), 2655--2694.
[28]
Heng Li, Weiyi Shang, Brayan Adams, Mohammed Sayagh, and Ahmed E. Hassan. 2020. A Qualitative Study of the Benefits and Costs of Logging from Developers' Perspectives. IEEE Transactions on Software Engineering 47 (2020), 2858--2873.
[29]
Heng Li, Weiyi Shang, and Ahmed E. Hassan. 2017. Which Log Level Should Developers Choose for a New Logging Statement? Empirical Softw. Engg. 22, 4 (2017), 1684--1716.
[30]
Jian Li, Yue Wang, Michael R. Lyu, and Irwin King. 2018. Code Completion with Neural Attention and Pointer Networks. In Proceedings of the 27th International Joint Conference on Artificial Intelligence. AAAI Press, 4159--25.
[31]
Zhenhao Li. 2020. Towards Providing Automated Supports to Developers on Writing Logging Statements. Association for Computing Machinery, New York, NY, USA, 198--201.
[32]
Zhenhao Li, Tse-Hsun (Peter) Chen, and Weiyi Shang. 2020. Where Shall We Log? Studying and Suggesting Logging Locations in Code Blocks. In Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering. Association for Computing Machinery, New York, NY, USA, 361--372.
[33]
Zhenhao Li, Tse-Hsun Peter Chen, Jinqiu Yang, and Weiyi Shang. 2021. Studying Duplicate Logging Statements and Their Relationships with Code Clones. IEEE Transactions on Software Engineering (2021).
[34]
Zhenhao Li, Heng Li, Tse-Hsun Chen, and Weiyi Shang. 2021. DeepLV: Suggesting Log Levels Using Ordinal Based Neural Networks. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE). IEEE Press, NJ, USA, 1461--1472.
[35]
Seppo Linnainmaa. 1976. Taylor expansion of the accumulated rounding error. BIT Numerical Mathematics 16 (1976), 146--160.
[36]
Scott Lundberg. 2019. SHAP Github Implementation. GitHub. Retrieved January 2, 2022 from https://github.com/slundberg/shap
[37]
Scott M. Lundberg, Gabriel Erion, Hugh Chen, Alex DeGrave, Jordan M. Prutkin, Bala Nair, Ronit Katz, Jonathan Himmelfarb, Nisha Bansal, and Su-In Lee. 2020. From local explanations to global understanding with explainable AI for trees. Nature Machine Intelligence 2, 1 (2020), 56--67.
[38]
Antonio Pecchia, Marcello Cinque, Gabriella Carrozza, and Domenico Cotroneo. 2015. Industry Practices and Event Logging: Assessment of a Critical Software Development Process. In 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, Vol. 2. IEEE Press, New York, USA, 169--178.
[39]
QOS. 2022. Simple Logging Faced for Java. QOS. Retrieved January 2, 2022 from https://www.slf4j.org/
[40]
Weiyi Shang, Zhen Ming Jiang, Bram Adams, Ahmed E. Hassan, Michael W. Godfrey, Mohamed Nasser, and Parminder Flora. 2014. An exploratory study of the evolution of communicated information about the execution of large software systems. Journal of Software: Evolution and Process 26 (2014), 3--26.
[41]
He Shilin, Zhu Jieming, He Pinjia, and Lyu Michael, R. 2016. Experience Report: System Log Analysis for Anomaly Detection. In 2016 IEEE 27th International Symposium on Software Reliability Engineering (ISSRE). IEEE Press, River Side, USA, 207--218.
[42]
Julius Sim and Chris C Wright. 2005. The Kappa Statistic in Reliability Studies: Use, Interpretation, and Sample Size Requirements. Physical Therapy 85 (2005), 257--268.
[43]
A. Plate Tony. 1995. Holographic reduced representations. IEEE Transactions on Neural Networks 6, 3 (1995), 623--641.
[44]
van der Aalst and et al. 2012. Process Mining Manifesto. In Business Process Management Workshops. Springer Berlin Heidelberg, Berlin, Heidelberg, 169--194.
[45]
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, undefined dukasz Kaiser, and Illia Polosukhin. 2017. Attention is All You Need. In Proceedings of the 31st International Conference on Neural Information Processing Systems. Curran Associates Inc., Red Hook, NY, USA, 6000--6010.
[46]
Andrew Watters and Sarah Boslaugh. 2008. Statistics in a Nutshell: A Desktop Quick Reference. O'Reilly Media, USA.
[47]
Ding Yuan, Soyeon Park, Peng Huang, Yang Liu, Michael M. Lee, Xiaoming Tang, Yuanyuan Zhou, and Stefan Savage. 2012. Be Conservative: Enhancing Failure Diagnosis with Proactive Logging. In 10th USENIX Symposium on Operating Systems Design and Implementation (OSDI 12). USENIX Association, Hollywood, CA, 293--306.
[48]
Ding Yuan, Soyeon Park, and Yuanyuan Zhou. 2012. Characterizing Logging Practices in Open-Source Software. In Proceedings of the 34th International Conference on Software Engineering. IEEE Press, River Street, USA, 102--112.
[49]
Ding Yuan, Jing Zheng, Soyeon Park, Yuanyuan Zhou, and Stefan Savage. 2012. Improving Software Diagnosability via Log Enhancement. ACM Trans. Comput. Syst. 30, 1 (2012), 3--14.
[50]
Yi Zeng, Jinfu Chen, Weiyi Shang, and Tse-Hsun (Peter) Chen. 2019. Studying the characteristics of logging practices in mobile apps: a case study on F-Droid. Empirical Software Engineering 24 (2019), 3394--3434.
[51]
Xu Zhao, Kirk Rodrigues, Yu Luo, Michael Stumm, Ding Yuan, and Yuanyuan Zhou. 2017. Log20: Fully Automated Optimal Placement of Log Printing Statements under Specified Overhead Threshold. In Proceedings of the 26th Symposium on Operating Systems Principles. Association for Computing Machinery, New York, NY, USA, 565--581.
[52]
Chen Zhi, Jianwei Yin, Shuiguang Deng, Maoxin Ye, Min Fu, and Tao Xie. 2019. An Exploratory Study of Logging Configuration Practice in Java. In 2019 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE Press, New York, USA, 459--469.
[53]
Jieming Zhu, Pinjia He, Qiang Fu, Hongyu Zhang, Michael R. Lyu, and Dongmei Zhang. 2015. Learning to Log: Helping Developers Make Informed Logging Decisions. In Proceedings of the 37th International Conference on Software Engineering - Volume 1. IEEE Press, River Street, USA, 415--425.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICPC '22: Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension
May 2022
698 pages
ISBN:9781450392983
DOI:10.1145/3524610
  • Conference Chairs:
  • Ayushi Rastogi,
  • Rosalia Tufano,
  • General Chair:
  • Gabriele Bavota,
  • Program Chairs:
  • Venera Arnaoudova,
  • Sonia Haiduc
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

In-Cooperation

  • IEEE CS

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 October 2022

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. deep learning
  2. log analysis
  3. log quality
  4. program comprehension

Qualifiers

  • Research-article

Conference

ICPC '22
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 65
    Total Downloads
  • Downloads (Last 12 months)20
  • Downloads (Last 6 weeks)0
Reflects downloads up to 10 Oct 2024

Other Metrics

Citations

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media