Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Implementing Log4j2 for Java Application Logging - Step-by-Step Tutorial

Automation Step by Step via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to implement logging functionality in your automation framework using Log4j2 through this 24-minute tutorial. Follow a step-by-step process starting with adding Log4j2 dependencies, creating configuration files, and setting up a Logger utility class. Master the integration of logging into various framework components including BaseTest.java, LoginPage.java, and LoginTest.java. Explore different logging levels (info, warn, error, debug) and understand how to view logs through console, command line, and log files. Gain hands-on experience with Maven commands for testing and log verification while working with an improved version of Log4j that offers enhanced performance and flexibility.

Syllabus

00:00 Intro
00:27 Step 1 - Add Log4j2 Dependency - Log4j 2 is an improved version of Log4j with better performance & flexibility
04:33 Step 2 - Update dependencies by running: mvn clean install
05:12 Step 3 - Create log4j2.xml Configuration File in src/main/resources
08:46 Step 4 - Create a Logger Utility Class Log.java in src/main/java/utils
14:50 Step 5 - Integrate Logging into BaseTest.java
18:20 Step 6 - Integrate Logging into LoginPage.java
21:00 Step 8 - Run the Test and View Logs. Can also use cmd mvn test and check logs

Taught by

Automation Step by Step

Reviews

Start your review of Implementing Log4j2 for Java Application Logging - Step-by-Step Tutorial

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.