Description : Log4j Example with BasicConfigurator and PropertyConfigurator Java /*>>>>>>>>>>>>>>>>Program1 with BasicConfigurator<<<<<<*/ /*>>>>>>>>>>>>>>>>SampleLog4j.java<<<<<<<<<<<<<<<<<<*/ package com.example; import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Level; import org.apache.log4j.Logger; public class SampleLog4j { static final Logger logger = Logger.getLogger(SampleLog4j.class); public static void main(String... args) { BasicConfigurator.configure(); Logger.getRootLogger().setLevel(Level.DEBUG); System.out.println(logger.isDebugEnabled()); logger.debug("Sample debug message"); logger.info("Sample info message"); logger.warn("Sample warn message"); logger.error("Sample error message"); logger.fatal("Sample fatal message"); } ...