Using Deep Learning to Generate Complete Log Statements
Antonio Mastropaolo, Luca Pascarella, Gabriele Bavota

TL;DR
This paper introduces LANCE, a deep learning approach that automatically generates complete log statements in Java code, including message content, log level, and injection points, to assist developers in effective logging practices.
Contribution
LANCE is the first model supporting comprehensive decision-making for log statement placement, content, and level using a large-scale transformer trained on millions of Java methods.
Findings
Properly identifies log injection points in 65.9% of cases
Selects correct log level in 66.2% of cases
Generates fully correct log statements in 15.2% of cases
Abstract
Logging is a practice widely adopted in several phases of the software lifecycle. For example, during software development log statements allow engineers to verify and debug the system by exposing fine-grained information of the running software. While the benefits of logging are undisputed, taking proper decisions about where to inject log statements, what information to log, and at which log level (e.g., error, warning) is crucial for the logging effectiveness. In this paper, we present LANCE (Log stAtemeNt reCommEnder), the first approach supporting developers in all these decisions. LANCE features a Text-To-Text-Transfer-Transformer (T5) model that has been trained on 6,894,456 Java methods. LANCE takes as input a Java method and injects in it a full log statement, including a human-comprehensible logging message and properly choosing the needed log level and the statement location.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware System Performance and Reliability · Software Engineering Research · Software Engineering Techniques and Practices
