skip to main content
10.1145/3377811.3380408acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Studying the use of Java logging utilities in the wild

Published:01 October 2020Publication History

ABSTRACT

Software logging is widely used in practice. Logs have been used for a variety of purposes like debugging, monitoring, security compliance, and business analytics. Instead of directly invoking the standard output functions, developers usually prefer to use logging utilities (LUs) (e.g., SLF4J), which provide additional functionalities like thread-safety and verbosity level support, to instrument their source code. Many of the previous research works on software logging are focused on the log printing code. There are very few works studying the use of LUs, although new LUs are constantly being introduced by companies and researchers. In this paper, we conducted a large-scale empirical study on the use of Java LUs in the wild. We analyzed the use of 3, 856 LUs from 11,194 projects in GitHub and found that many projects have complex usage patterns for LUs. For example, 75.8% of the large-sized projects have implemented their own LUs in their projects. More than 50% of these projects use at least three LUs. We conducted further qualitative studies to better understand and characterize the complex use of LUs. Our findings show that different LUs are used for a variety of reasons (e.g., internationalization of the log messages). Some projects develop their own LUs to satisfy project-specific logging needs (e.g., defining the logging format). Multiple uses of LUs in one project are pretty common for large and very largesized projects mainly for context like enabling and configuring the logging behavior for the imported packages. Interviewing with 13 industrial developers showed that our findings are also generally true for industrial projects and are considered as very helpful for them to better configure and manage the logging behavior for their projects. The findings and the implications presented in this paper will be useful for developers and researchers who are interested in developing and maintaining LUs.

References

  1. Apache Commons Logging. 2019. https://commons.apache.org/proper/commons-logging/. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  2. Apache Hadoop. 2019. https://hadoop.apache.org/. Last accessed: 08/22/2019.Google ScholarGoogle Scholar
  3. Apache Tomcat. 2019. http://tomcat.apache.org/. Last accessed: 08/22/2019.Google ScholarGoogle Scholar
  4. Sven Apel, Don Batory, Sven Apel, and Don Batory. 2008. How AspectJ is used: An analysis of eleven Aspectj programs. Journal of Object Technology (JOT) (2008).Google ScholarGoogle Scholar
  5. Lingfeng Bao, Xin Xia, David Lo, and Gail C. Murphy. 2019. A Large Scale Study of Long-Time Contributor Prediction for GitHub Projects. IEEE Transactions on Software Engineering (TSE) (2019).Google ScholarGoogle Scholar
  6. Titus Barik, Robert DeLine, Steven Drucker, and Danyel Fisher. 2016. The Bones of the System: A Case Study of Logging and Telemetry at Microsoft. In Companion Proceedings of the 38th International Conference on Software Engineering (ICSE-C), 2016.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Bitcoin Wallet. 2019. Bitcoin Wallet app for your Android device. https://github.com/bitcoin-wallet/bitcoin-wallet. Last accessed: 08/23/2019.Google ScholarGoogle Scholar
  8. Boyuan Chen and Zhen Ming (Jack) Jiang. 2016. Characterizing logging practices in Java-based open source software projects - a replication study in Apache Software Foundation. Empirical Software Engineering (EMSE) (2016).Google ScholarGoogle Scholar
  9. Boyuan Chen and Zhen Ming (Jack) Jiang. 2017. Characterizing and Detecting Anti-patterns in the Logging Code. In Proceedings of the 39th International Conference on Software Engineering (ICSE), 2017.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Boyuan Chen and Zhen Ming (Jack) Jiang. 2019. Extracting and studying the Logging-Code-Issue- Introducing changes in Java-based large-scale open source software systems. Empirical Software Engineering (EMSE) (2019).Google ScholarGoogle Scholar
  11. Rui Ding, Hucheng Zhou, Jian-Guang Lou, Hongyu Zhang, Qingwei Lin, Qiang Fu, Dongmei Zhang, and Tao Xie. 2015. Log2: A Cost-aware Logging Mechanism for Performance Diagnosis. In Proceedings of the 2015 Usenix Annual Technical Conference (ATC), 2015.Google ScholarGoogle Scholar
  12. Steve Easterbrook, Janice Singer, Margaret-Anne Storey, and Daniela Damian. 2008. Selecting Empirical Methods for Software Engineering Research.Google ScholarGoogle Scholar
  13. Eclipse Java IDE. 2019.. https://www.eclipse.org/ide/. Last accessed: 08/22/2019.Google ScholarGoogle Scholar
  14. Firebase. 2019. A mobile and web application development platform. https://firebase.google.com/. Last accessed: 08/23/2019.Google ScholarGoogle Scholar
  15. Martin Fowler, Kent Beck, John Brant, William Opdyke, and Don Roberts. 1999. Refactoring: Improving the Design of Existing Code. Addison-Wesley Longman Publishing Co., Inc.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Qiang Fu, Jieming Zhu, Wenlu Hu, Jian-Guang Lou, Rui Ding, Qingwei Lin, Dongmei Zhang, and Tao Xie. 2014. Where Do Developers Log? An Empirical Study on Logging Practices in Industry. In Companion Proceedings of the 36th International Conference on Software Engineering (ICSE-C), 2014.Google ScholarGoogle Scholar
  17. GitHub features. 2019. https://github.com/features. Last accessed: 07/29/2019.Google ScholarGoogle Scholar
  18. Mathieu Goeminne and Tom Mens. 2015. Towards a survival analysis of database framework usage in Java projects. In Proceedings of 31st International Conference on Software Maintenance and Evolution (ICSME), 2015.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Google Flogger. 2019. A Fluent Logging API for Java. https://github.com/google/flogger. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  20. Georgios Gousios. 2013. The GHTorrent dataset and tool suite. In Proceedings of the 10th Working Conference on Mining Software Repositories (MSR), 2013.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Jiawei Han. 2005. Data Mining: Concepts and Techniques. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA.Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Ahmed E. Hassan and Richard C. Holt. 2004. Using Development History Sticky Notes to Understand Software Architecture. In Proceedings of 12th International Workshop on Program Comprehension (IWPC), 2004,.Google ScholarGoogle Scholar
  23. Mehran Hassani, Weiyi Shang, Emad Shihab, and Nikolaos Tsantalis. 2018. Studying and detecting log-related issues. Empirical Software Engineering (EMSE) (2018).Google ScholarGoogle Scholar
  24. HBase. 2018. Apache HBase. https://hbase.apache.org. Last accessed: 01/29/2018.Google ScholarGoogle Scholar
  25. Pinjia He, Zhuangbin Chen, Shilin He, and Michael R. Lyu. 2018. Characterizing the Natural Language Descriptions in Software Logging Statements. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering (ASE), 2018.Google ScholarGoogle Scholar
  26. How to enable logging in dubbo? 2019. https://blog.csdn.net/JDream314/article/details/44620767. Last accessed: 08/21/2019.Google ScholarGoogle Scholar
  27. How to enable logging in Jetty. 2019. https://stackoverflow.com/questions/25786592/how-to-enable-logging-in-jettyt. Last accessed: 08/21/2019.Google ScholarGoogle Scholar
  28. Jez Humble and David Farley. 2010. Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation. Addison-Wesley Professional.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. IntelliJ IDEA. 2019. https://www.jetbrains.com/idea/. Last accessed: 08/22/2019.Google ScholarGoogle Scholar
  30. JBoss Logging. 2019. https://developer.jboss.org/wiki/JBossLoggingTooling. Last accessed: 07/16/2019.Google ScholarGoogle Scholar
  31. JDT Java Development Tools. 2019. https://eclipse.org/jdt/. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  32. Brittany Johnson, Yoonki Song, Emerson Murphy-Hill, and Robert Bowdidge. 2013. Why Don't Software Developers Use Static Analysis Tools to Find Bugs?. In Proceedings of the 35th International Conference on Software Engineering (ICSE), 2013.Google ScholarGoogle ScholarCross RefCross Ref
  33. Suhas Kabinna, Cor-Paul Bezemer, Weiyi Shang, and Ahmed E. Hassan. 2016. Logging Library Migrations: A Case Study for the Apache Software Foundation Projects. In Proceedings of the 13th International Conference on Mining Software Repositories (MSR), 2016.Google ScholarGoogle Scholar
  34. Eirini Kalliamvakou, Georgios Gousios, Kelly Blincoe, Leif Singer, Daniel German, and Daniela Damian. 2014. The Promises and Perils of Mining GitHub. In Proceedings of the 11th Working Conference on Mining Software Repositories (MSR), 2014.Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Lopes, Jean-Marc Loingtier, and John Irwin. 1997. Aspect-oriented programming.Google ScholarGoogle Scholar
  36. Pavneet Singh Kochhar, Dinusha Wijedasa, and David Lo. 2016. A Large Scale Study of Multiple Programming Languages and Code Quality. In Proceedings of the 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), 2016.Google ScholarGoogle ScholarCross RefCross Ref
  37. William H. Kruskal and W Allen Wallis. 1952. Use of Ranks in One-Criterion Variance Analysis. Journal of the American Statistical Association (JASA) (1952).Google ScholarGoogle Scholar
  38. Heng Li, Weiyi Shang, and Ahmed E. Hassan. 2017. Which Log Level Should Developers Choose for a New Logging Statement? Empirical Software Engineering (EMSE) (2017).Google ScholarGoogle Scholar
  39. Heng Li, Weiyi Shang, Ying Zou, and Ahmed E. Hassan. 2017. Towards just-in-time suggestions for log changes. Empirical Software Engineering (EMSE) (2017).Google ScholarGoogle Scholar
  40. Zhenhao Li, Tse-Hsun Chen, Jinqiu Yang, and Weiyi Shang. 2019. DLfinder: characterizing and detecting duplicate logging code smells. In Proceedings of the 41st International Conference on Software Engineering (ICSE), 2019.Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Jimmy Lin and Dmitriy Ryaboy. 2012. Scaling big data mining infrastructure: the twitter experience. SIGKDD Explorations 14, 2 (2012), 6--19.Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Log4J. 2019. A logging library for Java. http://logging.apache.org/log4j/1.2. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  43. LOG4J 2. 2019. Apache Log4j 2. http://logging.apache.org/log4j/2.x. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  44. log4net. 2019. log4net A logging library for .NET. https://logging.apache.org/log4net/. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  45. Logging dependency conflicts. 2019. https://cloud.tencent.com/developer/ask/121135. Last accessed: 08/21/2019.Google ScholarGoogle Scholar
  46. LogProvider in Ninja. 2019. https://github.com/ninjaframework/ninja. Last accessed: 08/22/2019.Google ScholarGoogle Scholar
  47. Cristina Lopes and Joel Ossher. 2015. How Scale Affects Structure in Java Programs. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2015.Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Mark Marron. 2018. Log++ Logging for a Cloud-native World. In Proceedings of the 14th ACM SIGPLAN International Symposium on Dynamic Languages (DLS), 2018.Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Maven plugin development guide. 2019. http://maven.apache.org/guides/plugin/guide-java-plugin-development.html. Last accessed: 08/23/2019.Google ScholarGoogle Scholar
  50. Multiple logging implementations found in Spring Boot. 2019. https://stackoverflow.com/questions/52911393/multiple-logging-implementations-found-in-spring-boot. Last accessed: 08/21/2019.Google ScholarGoogle Scholar
  51. Freddy Munoz, Benoit Baudry, Romain Delamare, and Yves Le Traon. 2013. Usage and Testability of AOP: An Empirical Study of AspectJ. Information and Software Technology (IST) (2013).Google ScholarGoogle Scholar
  52. OkHttp - an HTTP client for Android, Kotlin, and Java. 2019. https://github.com/square/okhttp. Last accessed: 08/23/2019.Google ScholarGoogle Scholar
  53. Adam Oliner, Archana Ganapathi, and Wei Xu. 2012. Advances and Challenges in Log Analysis. Communications of ACM (2012).Google ScholarGoogle Scholar
  54. Omni-Notes: note-taking application for Android. 2019. https://github.com/federicoiosue/Omni-Notes. Last accessed: 08/21/2019.Google ScholarGoogle Scholar
  55. Opentracing: vendor-neutral APIs and instrumentation for distributed tracing. 2019. https://opentracing.io/. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  56. Antonio Pecchia, Marcello Cinque, Gabriella Carrozza, and Domenico Cotroneo. 2015. Industry Practices and Event Logging: Assessment of a Critical Software Development Process. In Companion Proceedings of the 37th International Conference on Software Engineering (ICSE-C), 2015.Google ScholarGoogle ScholarCross RefCross Ref
  57. Liferay Portal. 2019. Liferay Portal - an open source enterprise web platform. https://github.com/liferay/liferay-portal. Last accessed: 08/22/2019.Google ScholarGoogle Scholar
  58. Baishakhi Ray, Daryl Posnett, Premkumar Devanbu, and Vladimir Filkov. 2017. A Large-scale Study of Programming Languages and Code Quality in GitHub. Communications of the ACM (2017).Google ScholarGoogle Scholar
  59. Red Hat Wildfly. 2019. https://wildfly.org/. Last accessed: 08/22/2019.Google ScholarGoogle Scholar
  60. Mohammed Sayagh, Noureddine Kerzazi, Bram Adams, and Fabio Petrillo. 2018. Software Configuration Engineering in Practice: Interviews, Survey, and Systematic Literature Review. IEEE Transactions on Software Engineering (TSE) (2018).Google ScholarGoogle Scholar
  61. Sentry - cross-platform application monitoring, with a focus on error reporting. 2019. https://sentry.io. Last accessed: 08/23/2019.Google ScholarGoogle Scholar
  62. Weiyi Shang, Zhen Ming Jiang, Bram Adams, Ahmed E. Hassan, Michael W. Godfrey, Mohamed Nasser, and Parminder Flora. 2014. An exploratory study of the evolution of communicated information about the execution of large software systems. Journal of Software: Evolution and Process (JSEP) (2014).Google ScholarGoogle Scholar
  63. Weiyi Shang, Meiyappan Nagappan, and Ahmed E. Hassan. 2015. Studying the relationship between logging characteristics and the code quality of platform software. Empirical Software Engineering (EMSE) (2015).Google ScholarGoogle Scholar
  64. Simple Logging Facade for Java (SLF4J). 2019. https://www.slf4j.org/. Last accessed: 08/12/2019.Google ScholarGoogle Scholar
  65. spdlog - Very fast, header-only/compiled, C++ logging library. 2019. https://github.com/gabime/spdlog. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  66. Spring Boot pull request 4341. 2019. https://github.com/spring-projects/spring-boot/issues/4341. Last accessed: 08/21/2019.Google ScholarGoogle Scholar
  67. Spring Cloud Sleuth. 2019. https://spring.io/projects/spring-cloud-sleuth. Last accessed: 08/23/2019.Google ScholarGoogle Scholar
  68. StackOverflow: Disable Logback in SpringBoot. 2019. https://stackoverflow.com/questions/23984009/disable-logback-in-springboot/23991715. Last accessed: 08/01/2019.Google ScholarGoogle Scholar
  69. Telegram - a cloud-based instant messaging service. 2019. https://github.com/DrKLO/Telegram. Last accessed: 08/21/2019.Google ScholarGoogle Scholar
  70. The replication package. 2020. https://www.eecs.yorku.ca/~chenfsd/resources/icse2020_replication.zip. Last accessed: 01/26/2020.Google ScholarGoogle Scholar
  71. The State of Logging in Java. 2019. https://stackify.com/logging-java/. Last accessed: 08/21/2019.Google ScholarGoogle Scholar
  72. Timber - a logger with a small, extensible API which provides utility on top of Android's normal Log class. 2019. https://github.com/JakeWharton/timber. Last accessed: 08/23/2019.Google ScholarGoogle Scholar
  73. TIOBE Index for August 2019. 2019. https://www.tiobe.com/tiobe-index/. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  74. Ultimate Guide to Logging. 2019. https://www.loggly.com/ultimate-guide/java-logging-basics/. Last accessed: 08/21/2019.Google ScholarGoogle Scholar
  75. Vertx - a tool-kit for building reactive applications on the JVM. 2019. https://github.com/eclipse-vertx/vert.x. Last accessed: 08/23/2019.Google ScholarGoogle Scholar
  76. What's Up with Logging in Java? 2019. https://stackoverflow.com/questions/354837/whats-up-with-logging-in-java. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  77. Why not use java.util.logging? 2019. https://stackoverflow.com/questions/11359187/why-not-use-java-util-logging. Last accessed: 07/23/2019.Google ScholarGoogle Scholar
  78. Stephen Yang, Seo Jin Park, and John Ousterhout. 2018. NanoLog: A Nanosecond Scale Logging System. In Proceedings of the 2018 USENIX Annual Technical Conference (ATC), 2018.Google ScholarGoogle Scholar
  79. Ding Yuan, Haohui Mai, Weiwei Xiong, Lin Tan, Yuanyuan Zhou, and Shankar Pasupathy. 2010. SherLog: error diagnosis by connecting clues from run-time logs. In Proceedings of the 15th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2010.Google ScholarGoogle ScholarDigital LibraryDigital Library
  80. Ding Yuan, Soyeon Park, Peng Huang, Yang Liu, Michael M. Lee, Xiaoming Tang, Yuanyuan Zhou, and Stefan Savage. 2012. Be Conservative: Enhancing Failure Diagnosis with Proactive Logging. In Proceedings of the 10th USENIX Conference on Operating Systems Design and Implementation (OSDI), 2012.Google ScholarGoogle Scholar
  81. Ding Yuan, Soyeon Park, and Yuanyuan Zhou. 2012. Characterizing Logging Practices in Open-source Software. In Proceedings of the 34th International Conference on Software Engineering (ICSE), 2012.Google ScholarGoogle ScholarDigital LibraryDigital Library
  82. Ding Yuan, Jing Zheng, Soyeon Park, Yuanyuan Zhou, and Stefan Savage. 2011. Improving Software Diagnosability via Log Enhancement. In Proceedings of the 16th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2011.Google ScholarGoogle ScholarDigital LibraryDigital Library
  83. Yi Zeng, Jinfu Chen, Weiyi Shang, and Tse-Hsun (Peter) Chen. 2019. Studying the characteristics of logging practices in mobile apps: a case study on F-Droid. Empirical Software Engineering (EMSE) (2019).Google ScholarGoogle Scholar
  84. Ahmed Zerouali and Tom Mens. 2017. Analyzing the evolution of testing library usage in open source Java projects. In Proceedings of the 24th International Conference on Software Analysis, Evolution and Reengineering (SANER), 2017.Google ScholarGoogle ScholarCross RefCross Ref
  85. Xu Zhao, Kirk Rodrigues, Yu Luo, Michael Stumm, Ding Yuan, and Yuanyuan Zhou. 2017. Log20: Fully Automated Optimal Placement of Log Printing Statements Under Specified Overhead Threshold. In Proceedings of the 26th Symposium on Operating Systems Principles (SOSP), 2017.Google ScholarGoogle ScholarDigital LibraryDigital Library
  86. Chen Zhi, Jianwei Yin, Shuiguang Deng, Maoxin Ye, Min Fu,, and Tao Xie. 2019. An Exploratory Study of Logging Configuration Practice in Java. In In Proceedings of the 35th IEEE International Conference on Software Maintenance and Evolution (ICSME), 2019.Google ScholarGoogle Scholar
  87. Jieming Zhu, Pinjia He, Qiang Fu, Hongyu Zhang, Michael R. Lyu, and Dongmei Zhang. 2015. Learning to Log: Helping Developers Make Informed Logging Decisions. In Proceedings of the 37th International Conference on Software Engineering (ICSE), 2015.Google ScholarGoogle ScholarCross RefCross Ref
  88. Jieming Zhu, Shilin He, JinyangLiu, Pinjia He, Qi Xie, Zibin Zheng, and Michael R. Lyu. 2019. Tools and benchmarks for automated log parsing. In Proceedings of the 41st International Conference on Software Engineering: Software Engineering in Practice, (ICSE-SEIP), 2019.Google ScholarGoogle Scholar

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Conferences
    ICSE '20: Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering
    June 2020
    1640 pages
    ISBN:9781450371216
    DOI:10.1145/3377811

    Copyright © 2020 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 1 October 2020

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Acceptance Rates

    Overall Acceptance Rate276of1,856submissions,15%

    Upcoming Conference

    ICSE 2025

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader