logo

More info
  • ReceivedApr 26, 2020
  • AcceptedAug 5, 2020
  • PublishedNov 9, 2020

Abstract

Log automation is a technique that helps developers write high-quality log code. When software systems fail, log code can ease the failure diagnosis process and reduce system recovery time. Existing log automation tools can be roughly classified into two groups: feature- and pattern-based tools. These existing tools define log placement rules by either extracting syntax features or summarizing code patterns, but they are hard to understand the source code's intention. In this paper, we design and implement SmartLog, which can create log statements based on deep understanding of log intention. To achieve this, we propose a log intention description model to describe the intention of log statements. SmartLog then explores the intentions of existing logs and mines log rules from those intentions. We evaluated SmartLog on six mature open-source projects. Compared with two state-of-the-art projects, i.e., Errlog and LogAdvisor, SmartLog improved the accuracy of log placement by 43% and 16% respectively. SmartLog could cover 49 out of 86 real-world patches aimed to add logs, while the state-of-the-art works could cover 10 and 22 patches, respectively.


Funded by

国家重点研发计划(2017YFB1001802)

国家自然科学基金(61872373,61872375)


References

[1] Yuan D, Park S, Huang P, et al. Be conservative: enhancing failure diagnosis with proactive logging. In: Proceedings of Symposium on Operating Systems Design and Implementation, Hollywood, 2012. 293--306. Google Scholar

[2] Zhu J M, He P J, Fu Q, et al. Learning to log: helping developers make informed logging decisions. In: Proceedings of International Conference on Software Engineering, Florence, 2015. 415--425. Google Scholar

[3] Yuan D, Zheng J, Park S, et al. Improving software diagnosability via log enhancement. Trans Comput Syst, 2011, 46: 3--14. Google Scholar

[4] Zhao X, Rodrigues K, Luo Y, et al. Log20: fully automated optimal placement of log printing statements under specified overhead threshold. In: Proceedings of Symposium on Operating Systems Principles, Shanghai, 2017. 565--581. Google Scholar

[5] Yao K D, Padua G, Shang W Y, et al. Log4Perf: suggesting logging locations for web-based systems' performance monitoring. In: Proceedings of International Conference on Performance Engineering, Berlin, 2018. 127--138. Google Scholar

[6] Ding R, Zhou H C, Lou J G, et al. Log2: a cost-aware logging mechanism for performance diagnosis. In: Proceedings of Annual Technical Conference, Santa Clara, 2015. 139--150. Google Scholar

[7] Li H, Shang W, Hassan A E. Which log level should developers choose for a new logging statement?. Empir Software Eng, 2017, 22: 1684-1716 CrossRef Google Scholar

[8] Kim T, Kim S, Yoo C, et al. An automatic approach to validating log levels in Java. In: Proceedings of Asia-Pacific Software Engineering Conference, Nara, 2018. 623--627. Google Scholar

[9] Cinque M, Cotroneo D, Pecchia A. Event Logs for the Analysis of Software Failures: A Rule-Based Approach. IIEEE Trans Software Eng, 2013, 39: 806-821 CrossRef Google Scholar

[10] Li S S, Niu X, Jia Z Y, et al. Guiding log revisions by learning from software evolution history. In: Proceedings of Conference on Program Comprehension, Gothenburg, 2018. 178--188. Google Scholar

[11] Yuan D, Park S, Zhou Y Y. Characterizing logging practices in open-source software. In: Proceedings of International Conference on Software Engineering, Zurich, 2012. 102--112. Google Scholar

[12] Fu Q, Zhu J M, Hu W L, et al. Where do developers log? An empirical study on logging practices in industry. In: Proceedings of International Conference on Software Engineering, Hyderabad, 2014. 24--33. Google Scholar

[13] Kabinna S, Shang W, Bezemer C, et al. Examining the stability of logging statements. In: Proceedings of International Conference on Software Analysis, Evolution, and Reengineering, Osaka, 2016. 326--337. Google Scholar

[14] Chen B Y, Jiang Z M. Characterizing and detecting anti-patterns in the logging code. In: Proceedings of International Conference on Software Engineering, Buenos Aires, 2017. 71--81. Google Scholar

[15] Pecchia A, Cinque M, Carrozza G, et al. Industry practices and event logging: assessment of a critical software development process. In: Proceedings of International Conference on Software Engineering, Florence, 2015. 169--178. Google Scholar

[16] Liao X K, Li S S, Dong W, et al. Survey on log research of large scale software system. J Softw, 2016, 27: 1934--1947. Google Scholar

[17] Barik T, DeLine R, Drucker S, et al. The bones of the system: a case study of logging and telemetry at Microsoft. In: Proceedings of International Conference on Software Engineering Companion, Austin, 2016. 92--101. Google Scholar

[18] Chen B, (Jack) Jiang Z M. Characterizing logging practices in Java-based open source software projects - a replication study in Apache Software Foundation. Empir Software Eng, 2017, 22: 330-374 CrossRef Google Scholar

[19] He P J, Chen Z B, He S L, et al. Characterizing the natural language descriptions in software logging statements. In: Proceedings of International Conference on Automated Software Engineering, Montpellier, 2018. 178--189. Google Scholar

[20] Zeng Y, Chen J, Shang W. Studying the characteristics of logging practices in mobile apps: a case study on F-Droid. Empir Software Eng, 2019, 24: 3394-3434 CrossRef Google Scholar

[21] Xu W, Huang L, Fox A, et al. Detecting large-scale system problems by mining console logs. In: Proceedings of Symposium on Operating Systems Principles, Big Sky, 2009. 117--132. Google Scholar

[22] Kadav A, Renzelmann M, Swift M. Tolerating hardware device failures in software. In: Proceedings of Symposium on Operating Systems Principles, Big Sky, 2009. 59--72. Google Scholar

[23] Yuan D, Mai H H, Xiong W W, et al. SherLog: error diagnosis by connecting clues from run-time logs. In: Proceedings of International Conference on Architectural Support for Programming Languages and Operating Systems, Pittsburgh, 2010. 143--154. Google Scholar

[24] Pecchia A, Russo S. Detection of software failures through event logs: an experimental study. In: Proceedings of International Symposium on Software Reliability Engineering, Dallas, 2012. 31--40. Google Scholar

[25] Duan R, Fang H, Zhan Y. Approach for mining block structure process from complex log using log partitioning. Comput Sci, 2019, 46: 334--339. Google Scholar

[26] Tang W X, Wang J H, He L J, et al. Design and implementation of log collection service platform for large-scale software system. Comput Appl Softw, 2018, 35: 173--178. Google Scholar

[27] Zhong Y, Guo Y B. Design and implementation of log parsing system based on machine learning. J Comput Appl, 2018, 38: 352--356. Google Scholar

[28] Zhang X, Ying S, Zhang T. Collection and service processing framework of application running log. Comput Eng Appl, 2018, 54: 81--89. Google Scholar

[29] Jia Z Y, Li S S, Liu X D, et al. SMARTLOG: place error log statement by deep understanding of log intention. In: Proceedings of International Conference on Software Analysis, Evolution and Reengineering, Campobasso, 2018. 61--71. Google Scholar