One Star

Logging successful job completion

I would like to be a ble to provide a full audit trail of all Talend jobs that are run. I can produce log files for jobs that fail with no problem but how do I output a log for successful completion i.e. the blue messages that appear in the run job window of Job Designer?
Starting job XXX_Run at 11:54 29/09/2009.
Job XXX_Run ended at 11:54 29/09/2009.
4 REPLIES
Employee

Re: Logging successful job completion

Hello,

You can use the tStatCatcher , it's one of the 3 catchers provided by Talend ( stat, log, flow )

tStatCatcher send 2 rows, first one at the beging of the job, second at the end, with exec time and return code of the job
One Star

Re: Logging successful job completion

Yes I tried checking the 'Use Statistics' box on the Job tab. This does produce the info but I have a job that runs every minute so I gave the stats file name the date and time as part of the file name. Because the job takes more than a second to run, I get 2 files produced - one with the start and another with the end - not much use.
What I require is all the information produced when running a job in Design Studio - start, any errors and end with exit code - output to a single file with the date & time in the file name so that I can have a generic job that scans the logs and emails support for any log that contains an error - exit code not 0.
Employee

Re: Logging successful job completion

I think your file name is like : "MyStatFile_"+TalendDate.getDate("CCYY-MM-DD hh:mm:ss")+".txt"
So you should create a routine to save the same date for job run
1) goto Exchange web page and download the tools routine
2) import tools in your project, tools contains the staticString function.
3) set your stats file name as "Stats_"+tools.staticString("stat",TalendDate.getDate("CCYYMMDD_ hhmmss"),false) +".txt"
Now you have the same file name at the begening and at the end of job run
One Star

Re: Logging successful job completion

Thanks emenuet, that's sorted the start & end of job. Can I put the log data to the same file - Answer yes but I'm not sure how to use the information if I have more than 1 stream in a job. If one stream fails I'm not sure how to distinguish it from another stream.