package log4j_testing; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; public class log4jexample { static Logger logger=Logger.getLogger(log4jexample.class); public static void main(String[] args) { // TODO Auto-generated method stub PropertyConfigurator.configure("log4j.properties"); logger.debug("this is a debug"); logger.info("this is an info"); logger.warn("this is a warning"); } }
log4j.rootLogger=INFO , file log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=D:\1.SUBJECTS\SEMESTER 07\SELF_QA\LOg4jExamplefiles\logging.log log4j.appender.file.MaxFileSize=12MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)