Software logging is an important software development practice which is used to trace important software execution points. This execution information can provide important insight to developer while software debugging. Inspite of many benefits logging is often done in an ad-hoc manner based only on knowledge and experience of software developer because of lack of formal guidelines and training required for making strategic logging decision. It is known that appropriate logging is beneficial for developers but inappropriate logging can have adverse effect on the system. Excessive logging can not only cause performance and cost overhead, it can also lessen the benefit of logging by producing tons of useless logs. Sparse logging can make logging ineffective by leaving out important information. In order to lessen the load of software developers and to improve the quality of software logging, in this work we propose 'LogOpt' tool to help developers in making informed logging decision. LogOpt uses static features from source code to make catch block logging decision. LogOpt is a machine learning based framework which learns the characteristics of logged and unlogged training instance to make informed logging decision. We manually analyze snippets of logged and unlogged source code and extracted 46 distinguishing features important in making logging decision. We evaluated LogOpt on two large open source projects Apache Tomcat and CloudStack (nearly 1.41M LOC). Results show that LogOpt is effective for automated logging task.
[1]
Ding Yuan,et al.
Improving Software Diagnosability via Log Enhancement
,
2012,
TOCS.
[2]
Jennifer Neville,et al.
Structured Comparative Analysis of Systems Logs to Diagnose Performance Problems
,
2012,
NSDI.
[3]
Ding Yuan,et al.
Characterizing logging practices in open-source software
,
2012,
2012 34th International Conference on Software Engineering (ICSE).
[4]
Qiang Fu,et al.
Learning to Log: Helping Developers Make Informed Logging Decisions
,
2015,
2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.
[5]
Wei Xu,et al.
Experience Mining Google's Production Console Logs
,
2010,
SLAML.
[6]
Qiang Fu,et al.
Where do developers log? an empirical study on logging practices in industry
,
2014,
ICSE Companion.