Pinned topic com.ibm.websphere.batch.BatchLogger logging methods
What then is the difference between these to methods?
Re: com.ibm.websphere.batch.BatchLogger logging methods2008-06-03T20:29:05ZThis is the accepted answer. This is the accepted answer.OK, we have made an error. BatchLogger is intended to be a private interface. It should not be in the documentation and it should not be in package name, com.ibm.websphere. It should have been com.ibm.ws, which is our convention for private interface. We'll figure out how we let this one get out of the lab.
The job log support is designed to capture all output written to the standard output and error streams by your application. So you can use System.out and System.err, respectively. Rather than using the standard streams directly, a good practice is to use log4j and its standard ConsoleAppender. Using log4j provides a good approach for controlling logging levels and layout.
Re: com.ibm.websphere.batch.BatchLogger logging methods2008-06-03T20:40:13ZThis is the accepted answer. This is the accepted answer.Well, ok, I didn't actually answer your question:
BatchLogger.logToFile() writes to the joblog. BatchLogger.log() writes to joblog and also sends a copy of the output line to the job scheduler. The latter exists to provide backward compatibility with Compute Grid v6.0, where container messages were logged in the scheduler's database. Only v6.0 container messages are handled that way. Those messages and all those added starting in v6.1 are logged in the joblog.
The best reason to not use the BatchLogger class in your application is because:
- log4j is much better
BatchLogger is not portable
It does not work in the BatchSimulator environment.