One Star

[resolved] Logging options in a parent-child job

I am using TOS v 3.1.2 and i have a parent and child job to read data from sybase database and generate XML files (one for each record). I am currently using the tWarn, tDie components along with tLogCatcher to generate log file from these jobs. I have the following questions on logging:
1. Is it possible to write the log information to a text file ( as opposed to excel, delimited file etc) ? If so how ?
2. Is it possible to change the schema of tLogCatcher or the output log file ? I only need very few elements (error message, timestamp etc) from the schema.
3. Is it possible to log the entire error (stack trace) into the log file. Looks like the message field only have the error message saying 'Child job failed', but i would like it also to print the reason for the failure as seen in the stack trace ( which is now printed on the console ).
Appreciate any help in this regard.
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] Logging options in a parent-child job

9 REPLIES
Community Manager

Re: [resolved] Logging options in a parent-child job

Hello
1. Is it possible to write the log information to a text file ( as opposed to excel, delimited file etc) ? If so how ?

Yes, it is possible. Just put a tLogCatcher+tFileInputDelimited in the job, it will catch the exception and output them into a file.
2. Is it possible to change the schema of tLogCatcher or the output log file ? I only need very few elements (error message, timestamp etc) from the schema.

Yes, link tLogCatcher to a tMap or tFilterColumn and you can only select the expected columns.
3. Is it possible to log the entire error (stack trace) into the log file. Looks like the message field only have the error message saying 'Child job failed', but i would like it also to print the reason for the failure as seen in the stack trace ( which is now printed on the console ).

If you want to catch the error message from the child job, you should put tLogCatcher in both father job and child job.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Logging options in a parent-child job

May please refer the well documented job at the following location
http://www.talendforge.org/exchange/tos/extension_view.php?eid=156
Thanks and Regards,
pravu Mishra.
One Star

Re: [resolved] Logging options in a parent-child job

Thanks for your comments Shong and Pravu.
One Star

Re: [resolved] Logging options in a parent-child job

well both the posts seems not able able to reply the Pravu's third question?
i.e How to all the console error messages in the log file. When we use tLogCatcher, we only get one simple message in log file saying "java.lang.RuntimeException:Child job running failed;1". But on console we can see the whole stack trace of the excpetion. I want log that stack trace in my log file. Please let me know how we can do that...
One Star

Re: [resolved] Logging options in a parent-child job

I am also looking for an option in Talend ( exactly same as 3rd requirment ) which can log all the console output in a log file . Is this possible ? So that job can show the cosole output ( whether job is successfull or failed) . I have created a custome talend component which has some system outputs which are displayed on console . I want to log these.
If talend has not any such capability , I will have only choice is " Create my own custom log file ( add entries in the component ) and log system outputs into it"
One Star

Re: [resolved] Logging options in a parent-child job

how to save all the console output in a log file?
i have a tOpenbravoERPOutput and when a run the job, console output show th id of object that was inserted ,i need to save this in a file.
how can i save ?
One Star

Re: [resolved] Logging options in a parent-child job

Hello
I am also most interested in such thing: I have developped a project for 8 months and there is one parent job calling dozens of child job.
In the child jobs, I oftenly use SysteSmiley SurprisedutSmiley Tonguerintln(); ni tJavas to display useful information.
Instead of going in all the child jobs and replace all the tjavas with tWarn and tDie, I would like to take all the console logs and throw the in a file.
Is it possible with Talend?
Thank you in advance.
H
One Star

Re: [resolved] Logging options in a parent-child job

Hi;
Anyone found a solution for this ? I would like to save the log of console to a file ..
regards
Fatih
One Star

Re: [resolved] Logging options in a parent-child job