SlideShare a Scribd company logo
Which log level should developers
choose for a new logging statement?
Journal-first Presentation | Empirical Software
Engineering
Heng Li Weiyi Shang Ahmed E.
Hassan
Logs are usually the only resource for
diagnosing field issues
2
A verbosity level can be assigned to
each logging statement
3
Log.info(“Log
message”)
Trace
Debu
g
Info
WarnErrorFatal
Log levels are used to disable some verbose
log messages while enable important ones
4
Trace
Debu
g
Info
WarnErrorFatal
Trace
Debu
g
Info
Warn
Error
Fatal Less verbose
levels
(higher levels)
More verbose
levels (lower
levels)
Log levels are used to disable some verbose
log messages while enable important ones
5
Trace
Debu
g
Info
Warn
Error
Fatal
System/module
level setting:
LogLevel = Warn
Less verbose
levels
(higher levels)
More verbose
levels (lower
levels)
Improper log levels can have many
negative impacts
6
“…tends to generate a lot of log noise…”
“These warnings worry users, especially first time users”
Researchers and industrial experts
highlighted the challenge of choosing proper
log levels
7
Developers spend much
efforts on adjusting log
levels
Severity levels are often
used inaccurately
[Oliner et al. CACM’12]
[Yuan et al. ICSE’12]
We want to suggest log levels when
developers add a new logging statement
8
Add a new
logging
statement
Which log
level should
be used?
+
Logger.level();
We study the code change history
of four subject systems
9
Over 2 M lines of code
Over 13 K logging statements
Added 17 K logging statements in history
Not single log level
dominates other log levels
13(0%)
2330(47%)
549(11%) 430(9%)
1655(33%)
185(4%)
1257(24%)
1839(35%)
1149(22%)
722(14%)
73(1%)
2(0%)
477(29%)
541(33%)
169(10%)
408(25%)
32(2%)
648(14%)
1603(36%)
985(22%)
459(10%)
799(18%)
2(0%)
0
1000
2000
0
500
1000
1500
2000
0
200
400
600
0
500
1000
1500
DirectoryServerHadoopHamaQpid
trace debug info warn error fatal
Log level
Numberoflogs
10Trace Debug Info Warn Error Fatal
Numberoflogs
95%
Developers spend much effort
adjusting log levels
11
Trace Debug Info Warn Error Fatal
Trace 0 25 2 0 0 0
Debug 16 9 41 3 7 1
Info 8 211 7 13 4 0
Warn 0 23 35 0 16 3
Error 0 12 23 23 2 4
Fatal 0 1 0 1 1 0
491 logging statements had at least
one log level change
Log level after changesInitial
log
level
Developers spend much effort
adjusting log levels
12
Trace Debug Info Warn Error Fatal
Trace 0 25 2 0 0 0
Debug 16 9 41 3 7 1
Info 8 211 7 13 4 0
Warn 0 23 35 0 16 3
Error 0 12 23 23 2 4
Fatal 0 1 0 1 1 0
72% of the log level changes
are from a higher level to a lower level
Log level after changesInitial
log
level
Developers spend much effort
adjusting log levels
13
Trace Debug Info Warn Error Fatal
Trace 0 25 2 0 0 0
Debug 16 9 41 3 7 1
Info 8 211 7 13 4 0
Warn 0 23 35 0 16 3
Error 0 12 23 23 2 4
Fatal 0 1 0 1 1 0
78% of the log level changes
are between adjacent levels
Log level after changesInitial
log
level
Developers spend much effort
adjusting log levels
14
Trace Debug Info Warn Error Fatal
Trace 0 25 2 0 0 0
Debug 16 9 41 3 7 1
Info 8 211 7 13 4 0
Warn 0 23 35 0 16 3
Error 0 12 23 23 2 4
Fatal 0 1 0 1 1 0
51% of the log level changes
are between “info” and “debug” levels
Log level after changesInitial
log
level
Which log level should developers choose
for a new logging statement?
15
RQ1: How well can we model the log
levels of logging statements?
RQ2: What are the important factors for
determining the log level of a logging
statement?
Which log level should developers choose
for a new logging statement?
16
RQ1: How well can we model the log
levels of logging statements?
RQ2: What are the important factors for
determining the log level of a logging
statement?
We derive 22 metrics from 5 dimensions
to model log levels
17
Logging statement
metrics
Containing block metrics
Containing file metrics
Code change metrics
Historical change metrics
The metrics are
extracted for each
logging statement,
at the time when the
logging statement is
added
We exclude the
logging statements
with subsequent log
level change
Order is important
18
Trace
Debug
Info
Warn
Error
Fatal
We use an Ordinal
Regression Model
for ordinal
responses
Higher
levels
Lower levels
Ordinal Regression Model
19
Logging statement
metrics
Containing block
metrics
Containing file metrics
Code change metrics
Historical change
metrics Trace
Debug
Info
Warn
Error
Fatal
Ordinal regression model can effectively
model log levels
20
0.76 0.78 0.81
0.75
0.4
0.5
0.6
0.7
0.8
0.9
1
Random
guess
AUC
The performance (AUC) of a within-project evaluation
Ordinal regression model can effectively
model log levels
21
0.76 0.78
0.81
0.750.72
0.76
0.8
0.71
0.4
0.5
0.6
0.7
0.8
0.9
1 Within-project Cross-project
The performance (AUC) of a cross-project
evaluation
AUC
Which log level should developers choose
for a new logging statement?
22
RQ1: How well can we model the log
levels of logging statements?
RQ2: What are the important factors for
determining the log level of a logging
statement?
We use a Wald 𝝌 𝟐 test to measure the
variable importance
23
Wald 𝝌 𝟐
Test
tests the significance of a variable against the null
hypothesis that the coefficient is equal to zero:
𝐻0: 𝜃 = 0
𝐻0: 𝜃0 = 𝜃1 = ⋯ = 𝜃 𝑘
Joint Wald 𝝌 𝟐 Test
tests the joint impact of a group
of
variables to a model’s fitness:
The most influential factors for log levels
are different for different projects
24
889
189
96
224
640
894
577
723
258
549
91
1134
5 0 0
78
0 67 0 0
0
500
1000
1500
The joint importance of each dimension of metrics
Logging statement metrics
Containing block metrics
Wald𝜒2statistic
The most influential factors for log levels
are different for different projects
25
889
189
96
224
640
894
577
723
258
549
91
1134
5 0 0
78
0 67 0 0
0
500
1000
1500
The joint importance of each dimension of metrics
Logging statement metrics
Containing block metrics
Wald𝜒2statistic
The most influential factors for log levels
are different for different projects
26
889
189
96
224
640
894
577
723
258
549
91
1134
5 0 0
78
0 67 0 0
0
500
1000
1500
The joint importance of each dimension of metrics
Logging statement metrics
Containing block metrics
Wald𝜒2statistic
27
Log levels are used to disable some verbose
log messages while enable important ones
Trace
Debug
Info
Warn
Error
Fatal
System/ module level
setting:
LogLevel = W arn
Less verbose levels
(higher levels)
More verbose
levels (lower levels)
Log levels are used to disable some verbose
log messages while enable important ones
Trace
Debug
Info
Warn
Error
Fatal
System/ module level
setting:
LogLevel = W arn
Less verbose levels
(higher levels)
More verbose
levels (lower levels)
28
29
Log levels are used to disable some verbose
log messages while enable important ones
Trace
Debug
Info
Warn
Error
Fatal
System/ module level
setting:
LogLevel = W arn
Less verbose levels
(higher levels)
More verbose
levels (lower levels)
30
31
Ordinal regression model can effectively
model log levels
0.72
0.76
0.8
0.71
0.76 0.78
0.81
0.75
0.4
0.5
0.6
0.7
0.8
0.9
1 Within-project Cross-project
The performance (AUC) of a cross-project evaluation
AUC
Log levels are used to disable some verbose
log messages while enable important ones
Trace
Debug
Info
Warn
Error
Fatal
System/ module level
setting:
LogLevel = W arn
Less verbose levels
(higher levels)
More verbose
levels (lower levels)
32
Ordinal regression model can effectively
model log levels
0.72
0.76
0.8
0.71
0.76 0.78
0.81
0.75
0.4
0.5
0.6
0.7
0.8
0.9
1 Within-project Cross-project
The performance (AUC) of a cross-project evaluation
AUC
33
Log levels are used to disable some verbose
log messages while enable important ones
Trace
Debug
Info
Warn
Error
Fatal
System/ module level
setting:
LogLevel = W arn
Less verbose levels
(higher levels)
More verbose
levels (lower levels)
34
Ordinal regression model can effectively
model log levels
0.72
0.76
0.8
0.71
0.76 0.78
0.81
0.75
0.4
0.5
0.6
0.7
0.8
0.9
1 Within-project Cross-project
The performance (AUC) of a cross-project evaluation
AUC
http://hengli.org
hengli@cs.queensu.ca

More Related Content

Similar to Which Log Level Should Developers Choose For a New Logging Statement?

Logs as Data: Using Logs to track Web Application Performance
Logs as Data: Using Logs to track Web Application PerformanceLogs as Data: Using Logs to track Web Application Performance
Logs as Data: Using Logs to track Web Application Performance
Trevor Parsons
 
Issre2014 test defectprediction
Issre2014 test defectpredictionIssre2014 test defectprediction
Issre2014 test defectprediction
Kim Herzig
 
LogMan 8.0 U S E R G U I D E
LogMan 8.0  U S E R  G U I D ELogMan 8.0  U S E R  G U I D E
LogMan 8.0 U S E R G U I D E
Ngo Hung Long
 
8 Channel Analog Data Logger
8 Channel Analog Data Logger8 Channel Analog Data Logger
8 Channel Analog Data Logger
Raghav Shetty
 
Embedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 CourseEmbedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 Course
FastBit Embedded Brain Academy
 
CIP IT Governance 5.0 Release Notes for ArcSight Logger
CIP IT Governance 5.0 Release Notes for ArcSight LoggerCIP IT Governance 5.0 Release Notes for ArcSight Logger
CIP IT Governance 5.0 Release Notes for ArcSight Logger
protect724rkeer
 
Honey process manager
Honey   process  managerHoney   process  manager
Honey process manager
Ashok Kumar Barla
 
Database Engineering and Operations at Yahoo
Database Engineering and Operations at YahooDatabase Engineering and Operations at Yahoo
Database Engineering and Operations at Yahoo
Ashwin Nellore
 
clase de evidencia y procedimiento
clase de evidencia y procedimientoclase de evidencia y procedimiento
clase de evidencia y procedimientomariaramossalgado
 
Lect05 Prog Model
Lect05 Prog ModelLect05 Prog Model
Lect05 Prog Model
anoosdomain
 
A tale of bug prediction in software development
A tale of bug prediction in software developmentA tale of bug prediction in software development
A tale of bug prediction in software developmentMartin Pinzger
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & Profiling
Isuru Perera
 
Gitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQL
Gerger
 
Gitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQL
Gerger
 
Websphere - Introduction to logs and configuration
Websphere -  Introduction to logs and configurationWebsphere -  Introduction to logs and configuration
Websphere - Introduction to logs and configuration
Vibrant Technologies & Computers
 
Accelerated Windows Debugging 3 training public slides
Accelerated Windows Debugging 3 training public slidesAccelerated Windows Debugging 3 training public slides
Accelerated Windows Debugging 3 training public slides
Dmitry Vostokov
 
4.9 apend troubleshooting tools v2
4.9 apend troubleshooting tools v24.9 apend troubleshooting tools v2
4.9 apend troubleshooting tools v2
Acácio Oliveira
 
ISV Error Handling With Spring '21 Update
ISV Error Handling With Spring '21 UpdateISV Error Handling With Spring '21 Update
ISV Error Handling With Spring '21 Update
CodeScience
 
Hp 34401 a multimeter
Hp 34401 a multimeterHp 34401 a multimeter
Hp 34401 a multimeterom_jambrong
 
S emb t10-development
S emb t10-developmentS emb t10-development
S emb t10-developmentJoão Moreira
 

Similar to Which Log Level Should Developers Choose For a New Logging Statement? (20)

Logs as Data: Using Logs to track Web Application Performance
Logs as Data: Using Logs to track Web Application PerformanceLogs as Data: Using Logs to track Web Application Performance
Logs as Data: Using Logs to track Web Application Performance
 
Issre2014 test defectprediction
Issre2014 test defectpredictionIssre2014 test defectprediction
Issre2014 test defectprediction
 
LogMan 8.0 U S E R G U I D E
LogMan 8.0  U S E R  G U I D ELogMan 8.0  U S E R  G U I D E
LogMan 8.0 U S E R G U I D E
 
8 Channel Analog Data Logger
8 Channel Analog Data Logger8 Channel Analog Data Logger
8 Channel Analog Data Logger
 
Embedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 CourseEmbedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 Course
 
CIP IT Governance 5.0 Release Notes for ArcSight Logger
CIP IT Governance 5.0 Release Notes for ArcSight LoggerCIP IT Governance 5.0 Release Notes for ArcSight Logger
CIP IT Governance 5.0 Release Notes for ArcSight Logger
 
Honey process manager
Honey   process  managerHoney   process  manager
Honey process manager
 
Database Engineering and Operations at Yahoo
Database Engineering and Operations at YahooDatabase Engineering and Operations at Yahoo
Database Engineering and Operations at Yahoo
 
clase de evidencia y procedimiento
clase de evidencia y procedimientoclase de evidencia y procedimiento
clase de evidencia y procedimiento
 
Lect05 Prog Model
Lect05 Prog ModelLect05 Prog Model
Lect05 Prog Model
 
A tale of bug prediction in software development
A tale of bug prediction in software developmentA tale of bug prediction in software development
A tale of bug prediction in software development
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & Profiling
 
Gitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQL
 
Gitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQLGitora, Version Control for PL/SQL
Gitora, Version Control for PL/SQL
 
Websphere - Introduction to logs and configuration
Websphere -  Introduction to logs and configurationWebsphere -  Introduction to logs and configuration
Websphere - Introduction to logs and configuration
 
Accelerated Windows Debugging 3 training public slides
Accelerated Windows Debugging 3 training public slidesAccelerated Windows Debugging 3 training public slides
Accelerated Windows Debugging 3 training public slides
 
4.9 apend troubleshooting tools v2
4.9 apend troubleshooting tools v24.9 apend troubleshooting tools v2
4.9 apend troubleshooting tools v2
 
ISV Error Handling With Spring '21 Update
ISV Error Handling With Spring '21 UpdateISV Error Handling With Spring '21 Update
ISV Error Handling With Spring '21 Update
 
Hp 34401 a multimeter
Hp 34401 a multimeterHp 34401 a multimeter
Hp 34401 a multimeter
 
S emb t10-development
S emb t10-developmentS emb t10-development
S emb t10-development
 

More from SAIL_QU

Studying the Integration Practices and the Evolution of Ad Libraries in the G...
Studying the Integration Practices and the Evolution of Ad Libraries in the G...Studying the Integration Practices and the Evolution of Ad Libraries in the G...
Studying the Integration Practices and the Evolution of Ad Libraries in the G...
SAIL_QU
 
Studying the Dialogue Between Users and Developers of Free Apps in the Google...
Studying the Dialogue Between Users and Developers of Free Apps in the Google...Studying the Dialogue Between Users and Developers of Free Apps in the Google...
Studying the Dialogue Between Users and Developers of Free Apps in the Google...
SAIL_QU
 
Improving the testing efficiency of selenium-based load tests
Improving the testing efficiency of selenium-based load testsImproving the testing efficiency of selenium-based load tests
Improving the testing efficiency of selenium-based load tests
SAIL_QU
 
Studying User-Developer Interactions Through the Distribution and Reviewing M...
Studying User-Developer Interactions Through the Distribution and Reviewing M...Studying User-Developer Interactions Through the Distribution and Reviewing M...
Studying User-Developer Interactions Through the Distribution and Reviewing M...
SAIL_QU
 
Studying online distribution platforms for games through the mining of data f...
Studying online distribution platforms for games through the mining of data f...Studying online distribution platforms for games through the mining of data f...
Studying online distribution platforms for games through the mining of data f...
SAIL_QU
 
Understanding the Factors for Fast Answers in Technical Q&A Websites: An Empi...
Understanding the Factors for Fast Answers in Technical Q&A Websites: An Empi...Understanding the Factors for Fast Answers in Technical Q&A Websites: An Empi...
Understanding the Factors for Fast Answers in Technical Q&A Websites: An Empi...
SAIL_QU
 
Investigating the Challenges in Selenium Usage and Improving the Testing Effi...
Investigating the Challenges in Selenium Usage and Improving the Testing Effi...Investigating the Challenges in Selenium Usage and Improving the Testing Effi...
Investigating the Challenges in Selenium Usage and Improving the Testing Effi...
SAIL_QU
 
The Impact of Task Granularity on Co-evolution Analyses
The Impact of Task Granularity on Co-evolution AnalysesThe Impact of Task Granularity on Co-evolution Analyses
The Impact of Task Granularity on Co-evolution Analyses
SAIL_QU
 
A Framework for Evaluating the Results of the SZZ Approach for Identifying Bu...
A Framework for Evaluating the Results of the SZZ Approach for Identifying Bu...A Framework for Evaluating the Results of the SZZ Approach for Identifying Bu...
A Framework for Evaluating the Results of the SZZ Approach for Identifying Bu...
SAIL_QU
 
How are Discussions Associated with Bug Reworking? An Empirical Study on Open...
How are Discussions Associated with Bug Reworking? An Empirical Study on Open...How are Discussions Associated with Bug Reworking? An Empirical Study on Open...
How are Discussions Associated with Bug Reworking? An Empirical Study on Open...
SAIL_QU
 
A Study of the Relation of Mobile Device Attributes with the User-Perceived Q...
A Study of the Relation of Mobile Device Attributes with the User-Perceived Q...A Study of the Relation of Mobile Device Attributes with the User-Perceived Q...
A Study of the Relation of Mobile Device Attributes with the User-Perceived Q...
SAIL_QU
 
A Large-Scale Study of the Impact of Feature Selection Techniques on Defect C...
A Large-Scale Study of the Impact of Feature Selection Techniques on Defect C...A Large-Scale Study of the Impact of Feature Selection Techniques on Defect C...
A Large-Scale Study of the Impact of Feature Selection Techniques on Defect C...
SAIL_QU
 
Studying the Dialogue Between Users and Developers of Free Apps in the Google...
Studying the Dialogue Between Users and Developers of Free Apps in the Google...Studying the Dialogue Between Users and Developers of Free Apps in the Google...
Studying the Dialogue Between Users and Developers of Free Apps in the Google...
SAIL_QU
 
What Do Programmers Know about Software Energy Consumption?
What Do Programmers Know about Software Energy Consumption?What Do Programmers Know about Software Energy Consumption?
What Do Programmers Know about Software Energy Consumption?
SAIL_QU
 
Threshold for Size and Complexity Metrics: A Case Study from the Perspective ...
Threshold for Size and Complexity Metrics: A Case Study from the Perspective ...Threshold for Size and Complexity Metrics: A Case Study from the Perspective ...
Threshold for Size and Complexity Metrics: A Case Study from the Perspective ...
SAIL_QU
 
Revisiting the Experimental Design Choices for Approaches for the Automated R...
Revisiting the Experimental Design Choices for Approaches for the Automated R...Revisiting the Experimental Design Choices for Approaches for the Automated R...
Revisiting the Experimental Design Choices for Approaches for the Automated R...
SAIL_QU
 
Measuring Program Comprehension: A Large-Scale Field Study with Professionals
Measuring Program Comprehension: A Large-Scale Field Study with ProfessionalsMeasuring Program Comprehension: A Large-Scale Field Study with Professionals
Measuring Program Comprehension: A Large-Scale Field Study with Professionals
SAIL_QU
 
On the Unreliability of Bug Severity Data
On the Unreliability of Bug Severity DataOn the Unreliability of Bug Severity Data
On the Unreliability of Bug Severity Data
SAIL_QU
 
On the Link Between Mobile App Quality and User Reviews
On the Link Between Mobile App Quality and User ReviewsOn the Link Between Mobile App Quality and User Reviews
On the Link Between Mobile App Quality and User Reviews
SAIL_QU
 
Mining Software Engineering Data
Mining Software Engineering DataMining Software Engineering Data
Mining Software Engineering Data
SAIL_QU
 

More from SAIL_QU (20)

Studying the Integration Practices and the Evolution of Ad Libraries in the G...
Studying the Integration Practices and the Evolution of Ad Libraries in the G...Studying the Integration Practices and the Evolution of Ad Libraries in the G...
Studying the Integration Practices and the Evolution of Ad Libraries in the G...
 
Studying the Dialogue Between Users and Developers of Free Apps in the Google...
Studying the Dialogue Between Users and Developers of Free Apps in the Google...Studying the Dialogue Between Users and Developers of Free Apps in the Google...
Studying the Dialogue Between Users and Developers of Free Apps in the Google...
 
Improving the testing efficiency of selenium-based load tests
Improving the testing efficiency of selenium-based load testsImproving the testing efficiency of selenium-based load tests
Improving the testing efficiency of selenium-based load tests
 
Studying User-Developer Interactions Through the Distribution and Reviewing M...
Studying User-Developer Interactions Through the Distribution and Reviewing M...Studying User-Developer Interactions Through the Distribution and Reviewing M...
Studying User-Developer Interactions Through the Distribution and Reviewing M...
 
Studying online distribution platforms for games through the mining of data f...
Studying online distribution platforms for games through the mining of data f...Studying online distribution platforms for games through the mining of data f...
Studying online distribution platforms for games through the mining of data f...
 
Understanding the Factors for Fast Answers in Technical Q&A Websites: An Empi...
Understanding the Factors for Fast Answers in Technical Q&A Websites: An Empi...Understanding the Factors for Fast Answers in Technical Q&A Websites: An Empi...
Understanding the Factors for Fast Answers in Technical Q&A Websites: An Empi...
 
Investigating the Challenges in Selenium Usage and Improving the Testing Effi...
Investigating the Challenges in Selenium Usage and Improving the Testing Effi...Investigating the Challenges in Selenium Usage and Improving the Testing Effi...
Investigating the Challenges in Selenium Usage and Improving the Testing Effi...
 
The Impact of Task Granularity on Co-evolution Analyses
The Impact of Task Granularity on Co-evolution AnalysesThe Impact of Task Granularity on Co-evolution Analyses
The Impact of Task Granularity on Co-evolution Analyses
 
A Framework for Evaluating the Results of the SZZ Approach for Identifying Bu...
A Framework for Evaluating the Results of the SZZ Approach for Identifying Bu...A Framework for Evaluating the Results of the SZZ Approach for Identifying Bu...
A Framework for Evaluating the Results of the SZZ Approach for Identifying Bu...
 
How are Discussions Associated with Bug Reworking? An Empirical Study on Open...
How are Discussions Associated with Bug Reworking? An Empirical Study on Open...How are Discussions Associated with Bug Reworking? An Empirical Study on Open...
How are Discussions Associated with Bug Reworking? An Empirical Study on Open...
 
A Study of the Relation of Mobile Device Attributes with the User-Perceived Q...
A Study of the Relation of Mobile Device Attributes with the User-Perceived Q...A Study of the Relation of Mobile Device Attributes with the User-Perceived Q...
A Study of the Relation of Mobile Device Attributes with the User-Perceived Q...
 
A Large-Scale Study of the Impact of Feature Selection Techniques on Defect C...
A Large-Scale Study of the Impact of Feature Selection Techniques on Defect C...A Large-Scale Study of the Impact of Feature Selection Techniques on Defect C...
A Large-Scale Study of the Impact of Feature Selection Techniques on Defect C...
 
Studying the Dialogue Between Users and Developers of Free Apps in the Google...
Studying the Dialogue Between Users and Developers of Free Apps in the Google...Studying the Dialogue Between Users and Developers of Free Apps in the Google...
Studying the Dialogue Between Users and Developers of Free Apps in the Google...
 
What Do Programmers Know about Software Energy Consumption?
What Do Programmers Know about Software Energy Consumption?What Do Programmers Know about Software Energy Consumption?
What Do Programmers Know about Software Energy Consumption?
 
Threshold for Size and Complexity Metrics: A Case Study from the Perspective ...
Threshold for Size and Complexity Metrics: A Case Study from the Perspective ...Threshold for Size and Complexity Metrics: A Case Study from the Perspective ...
Threshold for Size and Complexity Metrics: A Case Study from the Perspective ...
 
Revisiting the Experimental Design Choices for Approaches for the Automated R...
Revisiting the Experimental Design Choices for Approaches for the Automated R...Revisiting the Experimental Design Choices for Approaches for the Automated R...
Revisiting the Experimental Design Choices for Approaches for the Automated R...
 
Measuring Program Comprehension: A Large-Scale Field Study with Professionals
Measuring Program Comprehension: A Large-Scale Field Study with ProfessionalsMeasuring Program Comprehension: A Large-Scale Field Study with Professionals
Measuring Program Comprehension: A Large-Scale Field Study with Professionals
 
On the Unreliability of Bug Severity Data
On the Unreliability of Bug Severity DataOn the Unreliability of Bug Severity Data
On the Unreliability of Bug Severity Data
 
On the Link Between Mobile App Quality and User Reviews
On the Link Between Mobile App Quality and User ReviewsOn the Link Between Mobile App Quality and User Reviews
On the Link Between Mobile App Quality and User Reviews
 
Mining Software Engineering Data
Mining Software Engineering DataMining Software Engineering Data
Mining Software Engineering Data
 

Recently uploaded

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
abdulrafaychaudhry
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 

Recently uploaded (20)

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 

Which Log Level Should Developers Choose For a New Logging Statement?

  • 1. Which log level should developers choose for a new logging statement? Journal-first Presentation | Empirical Software Engineering Heng Li Weiyi Shang Ahmed E. Hassan
  • 2. Logs are usually the only resource for diagnosing field issues 2
  • 3. A verbosity level can be assigned to each logging statement 3 Log.info(“Log message”) Trace Debu g Info WarnErrorFatal
  • 4. Log levels are used to disable some verbose log messages while enable important ones 4 Trace Debu g Info WarnErrorFatal Trace Debu g Info Warn Error Fatal Less verbose levels (higher levels) More verbose levels (lower levels)
  • 5. Log levels are used to disable some verbose log messages while enable important ones 5 Trace Debu g Info Warn Error Fatal System/module level setting: LogLevel = Warn Less verbose levels (higher levels) More verbose levels (lower levels)
  • 6. Improper log levels can have many negative impacts 6 “…tends to generate a lot of log noise…” “These warnings worry users, especially first time users”
  • 7. Researchers and industrial experts highlighted the challenge of choosing proper log levels 7 Developers spend much efforts on adjusting log levels Severity levels are often used inaccurately [Oliner et al. CACM’12] [Yuan et al. ICSE’12]
  • 8. We want to suggest log levels when developers add a new logging statement 8 Add a new logging statement Which log level should be used? + Logger.level();
  • 9. We study the code change history of four subject systems 9 Over 2 M lines of code Over 13 K logging statements Added 17 K logging statements in history
  • 10. Not single log level dominates other log levels 13(0%) 2330(47%) 549(11%) 430(9%) 1655(33%) 185(4%) 1257(24%) 1839(35%) 1149(22%) 722(14%) 73(1%) 2(0%) 477(29%) 541(33%) 169(10%) 408(25%) 32(2%) 648(14%) 1603(36%) 985(22%) 459(10%) 799(18%) 2(0%) 0 1000 2000 0 500 1000 1500 2000 0 200 400 600 0 500 1000 1500 DirectoryServerHadoopHamaQpid trace debug info warn error fatal Log level Numberoflogs 10Trace Debug Info Warn Error Fatal Numberoflogs 95%
  • 11. Developers spend much effort adjusting log levels 11 Trace Debug Info Warn Error Fatal Trace 0 25 2 0 0 0 Debug 16 9 41 3 7 1 Info 8 211 7 13 4 0 Warn 0 23 35 0 16 3 Error 0 12 23 23 2 4 Fatal 0 1 0 1 1 0 491 logging statements had at least one log level change Log level after changesInitial log level
  • 12. Developers spend much effort adjusting log levels 12 Trace Debug Info Warn Error Fatal Trace 0 25 2 0 0 0 Debug 16 9 41 3 7 1 Info 8 211 7 13 4 0 Warn 0 23 35 0 16 3 Error 0 12 23 23 2 4 Fatal 0 1 0 1 1 0 72% of the log level changes are from a higher level to a lower level Log level after changesInitial log level
  • 13. Developers spend much effort adjusting log levels 13 Trace Debug Info Warn Error Fatal Trace 0 25 2 0 0 0 Debug 16 9 41 3 7 1 Info 8 211 7 13 4 0 Warn 0 23 35 0 16 3 Error 0 12 23 23 2 4 Fatal 0 1 0 1 1 0 78% of the log level changes are between adjacent levels Log level after changesInitial log level
  • 14. Developers spend much effort adjusting log levels 14 Trace Debug Info Warn Error Fatal Trace 0 25 2 0 0 0 Debug 16 9 41 3 7 1 Info 8 211 7 13 4 0 Warn 0 23 35 0 16 3 Error 0 12 23 23 2 4 Fatal 0 1 0 1 1 0 51% of the log level changes are between “info” and “debug” levels Log level after changesInitial log level
  • 15. Which log level should developers choose for a new logging statement? 15 RQ1: How well can we model the log levels of logging statements? RQ2: What are the important factors for determining the log level of a logging statement?
  • 16. Which log level should developers choose for a new logging statement? 16 RQ1: How well can we model the log levels of logging statements? RQ2: What are the important factors for determining the log level of a logging statement?
  • 17. We derive 22 metrics from 5 dimensions to model log levels 17 Logging statement metrics Containing block metrics Containing file metrics Code change metrics Historical change metrics The metrics are extracted for each logging statement, at the time when the logging statement is added We exclude the logging statements with subsequent log level change
  • 18. Order is important 18 Trace Debug Info Warn Error Fatal We use an Ordinal Regression Model for ordinal responses Higher levels Lower levels
  • 19. Ordinal Regression Model 19 Logging statement metrics Containing block metrics Containing file metrics Code change metrics Historical change metrics Trace Debug Info Warn Error Fatal
  • 20. Ordinal regression model can effectively model log levels 20 0.76 0.78 0.81 0.75 0.4 0.5 0.6 0.7 0.8 0.9 1 Random guess AUC The performance (AUC) of a within-project evaluation
  • 21. Ordinal regression model can effectively model log levels 21 0.76 0.78 0.81 0.750.72 0.76 0.8 0.71 0.4 0.5 0.6 0.7 0.8 0.9 1 Within-project Cross-project The performance (AUC) of a cross-project evaluation AUC
  • 22. Which log level should developers choose for a new logging statement? 22 RQ1: How well can we model the log levels of logging statements? RQ2: What are the important factors for determining the log level of a logging statement?
  • 23. We use a Wald 𝝌 𝟐 test to measure the variable importance 23 Wald 𝝌 𝟐 Test tests the significance of a variable against the null hypothesis that the coefficient is equal to zero: 𝐻0: 𝜃 = 0 𝐻0: 𝜃0 = 𝜃1 = ⋯ = 𝜃 𝑘 Joint Wald 𝝌 𝟐 Test tests the joint impact of a group of variables to a model’s fitness:
  • 24. The most influential factors for log levels are different for different projects 24 889 189 96 224 640 894 577 723 258 549 91 1134 5 0 0 78 0 67 0 0 0 500 1000 1500 The joint importance of each dimension of metrics Logging statement metrics Containing block metrics Wald𝜒2statistic
  • 25. The most influential factors for log levels are different for different projects 25 889 189 96 224 640 894 577 723 258 549 91 1134 5 0 0 78 0 67 0 0 0 500 1000 1500 The joint importance of each dimension of metrics Logging statement metrics Containing block metrics Wald𝜒2statistic
  • 26. The most influential factors for log levels are different for different projects 26 889 189 96 224 640 894 577 723 258 549 91 1134 5 0 0 78 0 67 0 0 0 500 1000 1500 The joint importance of each dimension of metrics Logging statement metrics Containing block metrics Wald𝜒2statistic
  • 27. 27 Log levels are used to disable some verbose log messages while enable important ones Trace Debug Info Warn Error Fatal System/ module level setting: LogLevel = W arn Less verbose levels (higher levels) More verbose levels (lower levels)
  • 28. Log levels are used to disable some verbose log messages while enable important ones Trace Debug Info Warn Error Fatal System/ module level setting: LogLevel = W arn Less verbose levels (higher levels) More verbose levels (lower levels) 28
  • 29. 29
  • 30. Log levels are used to disable some verbose log messages while enable important ones Trace Debug Info Warn Error Fatal System/ module level setting: LogLevel = W arn Less verbose levels (higher levels) More verbose levels (lower levels) 30
  • 31. 31 Ordinal regression model can effectively model log levels 0.72 0.76 0.8 0.71 0.76 0.78 0.81 0.75 0.4 0.5 0.6 0.7 0.8 0.9 1 Within-project Cross-project The performance (AUC) of a cross-project evaluation AUC
  • 32. Log levels are used to disable some verbose log messages while enable important ones Trace Debug Info Warn Error Fatal System/ module level setting: LogLevel = W arn Less verbose levels (higher levels) More verbose levels (lower levels) 32 Ordinal regression model can effectively model log levels 0.72 0.76 0.8 0.71 0.76 0.78 0.81 0.75 0.4 0.5 0.6 0.7 0.8 0.9 1 Within-project Cross-project The performance (AUC) of a cross-project evaluation AUC
  • 33. 33
  • 34. Log levels are used to disable some verbose log messages while enable important ones Trace Debug Info Warn Error Fatal System/ module level setting: LogLevel = W arn Less verbose levels (higher levels) More verbose levels (lower levels) 34 Ordinal regression model can effectively model log levels 0.72 0.76 0.8 0.71 0.76 0.78 0.81 0.75 0.4 0.5 0.6 0.7 0.8 0.9 1 Within-project Cross-project The performance (AUC) of a cross-project evaluation AUC http://hengli.org hengli@cs.queensu.ca

Editor's Notes

  1. Log levels are beneficial for both developers and users to trade-off the rich information in logs with their associated overhead.
  2. the ordinal regression model is used to predict an ordinal dependent variable, i.e., a variable with categorical values where the relative ordering between different values is important. We leverage ordinal regression models in automated log level prediction because log level has a small number (e.g., six) of categorical values and the relative ordering among these categorical values is important, hence neither a logistic regression model nor a classification model is as appropriate as an ordinal regression model.
  3. Need to update the data
  4. Need to update the data