Modified Design for Log4Unit Library: Abstraction of Logging Implementation using a Simple Logging Facade (SLF4JUnit)

Jatin Ambasana, Deepti Ameta, Rama M. Maliya, Dhaval Parikh · 2023

This paper presents the original work which revolves around making of a Logging Library for JUnit by combining Simple Logging Facade for Java (SLF4J) and JUnit libraries in to Simple Logging Facade for JUnit (SLF4JUnit). It is a combination of techniques gathered from these frameworks to form an inbuilt logging facade for JUnit. There are some similar libraries available like Log4Unit, which is an extension of JUnit and combines JUnit with Log4J. The main use of Log4Unit is to create test protocols for JUnit. SLF4J serves as a simple facade or abstraction for various logging frameworks, e.g. java.util.logging, log4j and logback, allowing the end user to plug in the desired logging framework at deployment time. The characteristic of Log4Unit that prompted the work behind this research is that it becomes tightly coupled with the underlying logging framework (the default Log4J or the customized one, whichever the user implements). To overcome this rigid situation, SLF4JUnit framework will be using the logging facade- SLF4J. This will provide loose coupling of logging library with the underlying logging framework. Since the Log4Unit Library is open-source it can also be customized to support the business requirements of individual organizations. This work is an attempt to change the structure of Log4Unit library in such a way that it can be coupled with any underlying logging framework like log4j, java.util.logging package or log- back library. This paper presents how Log4Unit library can be redesigned by abstracting its logging implementation through a facade like SLF4J so as to decouple it from the logging library, thus making it independent of underlying logging framework.

Read the paper · More papers on PaperTik