Using Logback
Explore how to implement Logback to enhance logging performance in Java-based test automation frameworks. Understand configuration with logback.xml, log levels hierarchy, and practical setup for logging to console and files. This lesson prepares you for integrating automatic logging in future steps.
We'll cover the following...
We'll cover the following...
Logback #
Logback is intended as a successor to the popular log4j project that is used for logging to console and file. The main advantage of using logback over log4j is that its internals has been re-written to perform about ten times faster and has a smaller memory footprint as well.
Here, we can find a reason to use logback over log4j.
Dependency to add #
Maven #
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
Gradle #
compile group: 'ch.qos.logback', name: 'logback-classic', version: ...