Intention-aware Log Automation

Zhouyang JIA,Shanshan LI,Xiaodong LIU,Ji WANG,Xiangke LIAO
DOI: https://doi.org/10.1360/ssi-2020-0111
2020-01-01
Scientia Sinica Informationis
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 codes 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.
What problem does this paper attempt to address?