Issue
i am trying to setup log4j to my java web application based on Maven on Netbeans 12.6 , And i am following this video: enter link description here in this tutorial the logging will be writing into a file.
But in my case after running the application no log file created
Solution
ALL PROBLEMS SOLVED! For Log4J logging to a file on Netbeans
Step 1: Import log4j-1.2.17.jar library to your project
Step 2: First we need to move the log4.properties to a separate directory that we need to create by our self with the name "src/test/resources". For that, Right click on your main project in my case is "Log4Shell" --> then from the categories choose "Other" --> then chose "Properties File" --> then gave it a name "src/test/resources".
Step 3: create a new file properties: Right Click on --> new --> Properties File --> File Name:log4j.properties
Step 4: we need to create a javaclass under the Test Package repository
Step 5: Time for test: Right click on "NewClass.java"-->Debug Test File. Result OK:
Answered By - vraihack
Answer Checked By - Candace Johnson (JavaFixing Volunteer)