一句话:通过访谈与问卷提炼日志消息可读性的结构、信息与措辞准则,并用机器学习自动分类其可读性。
日志消息的可读性直接影响日志分析的价值,但目前尚缺乏关于什么是良好可读性以及如何撰写日志消息的标准。本文访谈了17名工业从业者,提炼出与日志消息可读性相关的三个方面:结构、信息和措辞,并总结出若干改进实践;随后通过在线问卷验证这些发现,获得参与者的积极反馈。作者还人工调查了大型开源系统中的日志消息,发现相当大比例(38.1%)的可读性不足。受此驱动,进一步探索使用深度学习和机器学习模型自动分类日志消息可读性,发现这些模型平均能达到80.0%以上的平衡准确率。该研究为撰写日志消息提供了综合指南,以改进从业者的日志实践。
Developers write logging statements to generate logs that provide run-time information for various tasks. The readability of log messages in the logging statements (i.e., the descriptive text) is rather crucial to the value of the generated logs. Immature log messages may slow down or even obstruct the process of log analysis. Despite the importance of log messages, there is still a lack of standards on what constitutes good readability of log messages and how to write them. In this paper, we conduct a series of interviews with 17 industrial practitioners to investigate their expectations on the readability of log messages. Through the interviews, we derive three aspects related to the readability of log messages, including Structure, Information, and Wording, along with several specific practices to improve each aspect. We validate our findings through a series of online questionnaire surveys and receive positive feedback from the participants. We then manually investigate the readability of log messages in large-scale open source systems and find that a large portion (38.1%) of the log messages have inadequate readability. Motivated by such observation, we further explore the potential of automatically classifying the readability of log messages using deep learning and machine learning models. We find that both deep learning and machine learning models can effectively classify the readability of log messages with a balanced accuracy above 80.0% on average. Our study provides comprehensive guidelines for composing log messages to further improve practitioners' logging practices.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{LiCHXCS23,
title = {Are They All Good? Studying Practitioners' Expectations on the Readability of Log Messages},
author = {Zhenhao Li and An Ran Chen and Xing Hu and Xin Xia and Tse-Hsun Chen and Weiyi Shang},
booktitle = {ASE},
year = {2023},
doi = {10.1109/ase56229.2023.00136}
}