I am using Properties instead of log4j.properties. Here sample is the package, which is to be WARN level. I am not successful in this case. Please help me in this regard.
Following is the Properties I am setting...
________________________________________________
Properties props = new Properties();
props.put("log4j.rootCategory",value+",A2");
props.put("log4j.appender.A2","org.apache.log4j.RollingFileAppender");
props.put("log4j.appender.A2.File","./config/"+domainName+"/out");
props.put("log4j.appender.A2.MaxFileSize","1000KB");
props.put("log4j.appender.A2.MaxBackupIndex","30");
props.put("log4j.appender.A2.layout","org.apache.log4j.PatternLayout");
props.put("log4j.appender.A2.layout.ConversionPattern","%d{DATE} %-5p %x : %c - %m%n");
props.put("log4j.logger.sample","WARN,A2");
if (!log4jPropsLoaded) {
PropertyConfigurator.configure(props);
log4jPropsLoaded = true;
}
________________________________________________
Thanks,
Murthy P