Thanks for the reply,
I mistyped the file name. Actually it is log4j.properties.
An update regarding the issue. I managed to get my logger messages in a file using the following code in my java class:
public class QuartzReport {
static Logger log = Logger.getLogger("QuartzReport");
public static void main(String[] args) {
try {
DateFormat format3 = new SimpleDateFormat( "MM_dd_yyyy_HH_mm" );
Date dateToday = new Date();
String strToday= format3.format(dateToday);
BasicConfigurator.configure();
PatternLayout pattern = new PatternLayout("%r [%t] %-5p %c %x - %m%n");
FileAppender fileappender = new FileAppender(pattern,"log\\CenoplexScheduler_"+strToday+".txt");
log.addAppender(fileappender);
log.info("QuartzReport; main(): [** Starting scheduler services **]");
}
}
}
However, the issue now I am facing is my logger is printing so much of data that I dont need.I am pasting a portion of my logger below:
7068384 [DefaultQuartzScheduler_Worker-2] INFO QuartzReport - SchedulerJob; execute(): [** Calling doJob() of BackgroundProcessANIParsing **]
7068384 [DefaultQuartzScheduler_Worker-2] INFO QuartzReport - BackgroundProcessANIParsing; doJob(): [Background process for ANI parsing begins]
7068384 [DefaultQuartzScheduler_Worker-2] INFO QuartzReport - BackgroundProcessANIParsing; doJob(): [Getting all campaigns from campaign table to parse]
7068384 [DefaultQuartzScheduler_Worker-2] INFO QuartzReport - BackgroundProcessANIParsing; doJob(): [No campaign ANI record found to parse]
7068384 [DefaultQuartzScheduler_Worker-2] INFO QuartzReport - BackgroundProcessANIParsing; doJob(): [Background process for ANI parsing ends]
7128387 [DefaultQuartzScheduler_Worker-4] INFO QuartzReport - SchedulerJob; execute(): [** Calling doJob() of BackgroundProcessANIParsing **]
7
Also, here is my log4j.properties file contents:
# STDOUT appender
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%d %p [%t] %C{1} - %m\n
# use the STDOUT appender. set the level to INFO.
log4j.category.com.devdaily.log4jdemo.Log4JDemo=INFO, STDOUT
The problem seems to be with my properties file itself.
Regards,
Ibu