One Star

[resolved] Save run console output in a log file

I have many sub jobs where I am using tlogrow to display the output in run console.
When I run the main job I can see the result in the run console.Now I want to save the content of this run console to some log file.
Is there any way to achieve this?
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] Save run console output in a log file

How exactly do you do this. I am trying to capture this very information with no success. I have a tMySQLOutput I am trying to log errors on. I can't connect to a tLogCatcher from there or a tLogRow. All I have been able to do is use tWarn but you can't get system error info like the console errors you have posted.

tLogCatcher component do not need any incoming connector, refer to the online component manual and learn its usage.
https://help.talend.com/search/all?query=tLogCatcher&content-lang=en
In addition, you can redirect the entire message printed on the console to a log file thanks to a custom component tRedirectOutput developed and shared by brazabr, for more details, read this topic:
http://www.talendforge.org/forum/viewtopic.php?pid=108078#p108078
----------------------------------------------------------
Talend | Data Agility for Modern Business
8 REPLIES
One Star

Re: [resolved] Save run console output in a log file

try to link tLogRow to tFileOutputDelimited.
One Star

Re: [resolved] Save run console output in a log file

does this method method work?? cause I am trying to implement the same thing.
One Star

Re: [resolved] Save run console output in a log file

I am trying to link tLogRow to tFileOutputDelimited, but doesnt work...
any suggestions further?
Community Manager

Re: [resolved] Save run console output in a log file

Hi
We usually use tLogCatcher to capture the error message and log them into file or database, but it is impossible to output the full stack trace to a file. For example, below are the message printed on the console when a job runs failed,
Starting job te at 03:04 19/02/2013.

Exception in component tJava_1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1931)
at projectname.te_0_1.te.tFileList_1Process(te.java:422)
at projectname.te_0_1.te.runJobInTOS(te.java:669)
at projectname.te_0_1.te.main(te.java:530)
Job te ended at 03:04 19/02/2013.

We can capture the error message "String index out of range: -1" with tLogCatcher component, not the full stack trace.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Save run console output in a log file

How exactly do you do this. I am trying to capture this very information with no success. I have a tMySQLOutput I am trying to log errors on. I can't connect to a tLogCatcher from there or a tLogRow. All I have been able to do is use tWarn but you can't get system error info like the console errors you have posted.
Community Manager

Re: [resolved] Save run console output in a log file

How exactly do you do this. I am trying to capture this very information with no success. I have a tMySQLOutput I am trying to log errors on. I can't connect to a tLogCatcher from there or a tLogRow. All I have been able to do is use tWarn but you can't get system error info like the console errors you have posted.

tLogCatcher component do not need any incoming connector, refer to the online component manual and learn its usage.
https://help.talend.com/search/all?query=tLogCatcher&content-lang=en
In addition, you can redirect the entire message printed on the console to a log file thanks to a custom component tRedirectOutput developed and shared by brazabr, for more details, read this topic:
http://www.talendforge.org/forum/viewtopic.php?pid=108078#p108078
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Save run console output in a log file

We're presuming that you've set up a DB with appropriate table names for logging... http://www.talendforge.org/tutorials/tutorial.php?idTuto=31
One Star

Re: [resolved] Save run console output in a log file

Thanks for the reply. I do have a db setup with the correct table definition. I see now that the tlogCatcher grabs the Java exception and user defined warnings through the tDie and tWarn. I was under the impression it only listened to tDie & tWarn. Apparently I are not good at reedn. Smiley Sad
Thanks for the heads up on the redirect!