Automatic use of Stats and Logs

One Star

Automatic use of Stats and Logs

Hi,
I want to monitor the execution of a large set of Jobs through the creation of stats and log files. I have set permanent preferences in but I don't understand some aspects of this automatic use of stats and logs.
1) By this way, is not mandatory to use single Logs & Error components in every Job? 
2) The file relative to stats data is always generated, but not the others relative to log and flow meter data. These last are generated only in specific cases?
3) How to modify schema of these file without using single component in every Job?
4) Is it possible to print database error messages in log files? For example, print an error message of violation of primary key (or foreign key) constraint.
Thanks in advance. 
Moderator

Re: Automatic use of Stats and Logs

Hi,
You don't need to use a single Logs & Error components in every Job. 
Talend  provides user with Stat&log in project setting and Stat&log in job view.
Stat&log in project setting is working on the whole project (Parent job and child jobs, and output them on file/DB but no context setting).
Stat&log in job view is working on the current job (you should set Stat&log of job view in both parent job and child jobs and output them on file/DB with context setting)
Statistics table records details like begin Time, End Time which is generated by any job.
Logs table records the messages from Java Exception, tDie and/or tWarn (prerequisite: there must be a error in your job).
Flow Meter table records the number of rows processed in the defined flow(prerequisite: you should use tFlowMeter in your job)
If you want to modify schema of log/stat file, you have to use  single component.
For example: tlogcather-->tMap(modify schema)-->tfileXXXoutput..

Logs table records the messages from Java Exception, tDie and/or tWarn
Feel free to let us know if it is helpful for you.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Automatic use of Stats and Logs

Hi Sabrina,
thank you for your reply. Please can you tell me difference between these two following pictures?



I use tWarn_1 and tWarn_2 for write to log file (set in the Project Settings) when the job starts and when it's completed respectively. But what is the difference of use OnSubjobOk between the input table and tWarn_2 and of use OnComponentOk between output table and tWarn_2 for this purpose?
Thanks in advance.