Skip to content

Quantitative Assessment of Log Quality in Large-Scale Software

Notifications You must be signed in to change notification settings

ZhouyangJia/LogGrad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogGrad

Quantitative Assessment of Log Quality in Large-Scale Software.


Introduction

LogGrad is a light weight log-quality assessment tool, which is based on Clang. Given a set of projects, LogGrad can automatically rank them by log quality. The basic idea of ranking is that to what extent the given project misses logs. The missing logs are classified into 3 types, including project-specific logs, intra-domain important logs and inter-domain important logs.

高质量的日志代码是软件故障诊断的重要依据。由于缺乏统一规范、开发人员不够重视等原因,现有软件中的日志质量参差不齐。针对这一问题,设计并实现了面向大规模软件的日志质量评估工具LogGrad,定量评估日志质量。LogGrad首先分析软件源码,采用与SmartLog相似的方法挖掘软件日志规则。之后,LogGrad检测源码中违反日志规则的代码段,并计算日志缺失率,即缺失日志的函数调用数量除以函数调用总数。

Usage

Compile
  • Change directory to Clang tools directory.
cd path/to/llvm-source-tree/tools/clang/tools
  • Download source code.
git clone https://github.com/ZhouyangJia/LogGrad.git
  • Add add_subdirectory(LogGrad) to CMakeList.txt.
echo "add_subdirectory(LogGrad)" >> CMakeLists.txt
ls path/to/llvm-build/Release/bin/clang-loggrad
Analyze log information
cd test/
tar zxvf bftpd-3.2.tar
cd bftpd/
./configure
bear make
  • Generate compiled_files.def, This file has all names of compiled source files.
../../script/extract_command.pl compile_commands.json
  • Generate function_rule_model.out. Each line includes a 3-tuple, namely function name, called time and logged time.
cat compiled_files.def | xargs clang-loggrad -log-grade
  • Rename the output file. Other output files are in script/results.
mv function_rule_model.out bftpd.out
Assessment

Each output file represents one project followed by a domain name.

cd ../../script/
python loggrad.py results/httpd.out httpd results/nginx.out httpd results/lighttpd.out httpd results/mongrel2.out httpd results/mysql.out database results/postgresql.out database results/berkeleydb.out database results/monetdb.out database

About

Quantitative Assessment of Log Quality in Large-Scale Software

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published