[resolved] save output in run-window to txt file

Highlighted
One Star

Re: [resolved] save output in run-window to txt file

Thank you Shong
Highlighted
Five Stars

Re: [resolved] save output in run-window to txt file

Hi Shong,

 

Since it has been serveral years after this function has been asked for, has this implanted into generic Talend functions yet?

 

I have a project need to log every single error into a file, including some errors like ('unparsable date format' etc.) which tlogcatcher can not catch. I am sure I can use schema check to solve some of the cases. But if I can just write whatever shows in the console to a file will be easier way to do right?

 

Because it is a huge project that almost not realistic change every single subjob so I can only make change to the parent job, so the tRedirectOuput may be not the best choice for me.

 

Please let me know if there is any update. Thanks. 

Highlighted
Four Stars

Re: [resolved] save output in run-window to txt file

Hi,

I have used tRedirectOutput component on my Talend job which is scheduled on windows but i am unable to redirect the output to .txt file.I have selected System.out option with append option.Please help me.

Highlighted
Moderator

Re: [resolved] save output in run-window to txt file

Hello,

What's talend build version you are using? Is this custom component tRedirectOutput compatible with your current studio version?

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.
Highlighted
Four Stars

Re: [resolved] save output in run-window to txt file

Hello Sabrina,

Thank you for your reply,
the build version is 6.4 and tRedirectOutput is custom component compatible
with this version.If i run the job on talend studion in local, it is
sending all System.out log into the file but on server(windows) i have
scheduled the job where it is not able to collect the System.out into the
file.Please help.

Regards,
Shivaraj
Highlighted
Moderator

Re: [resolved] save output in run-window to txt file

Hello Shivaraj,

Could you please stick to one topic:https://community.talend.com/t5/Design-and-Development/unable-to-log-output-from-tRedirectOutput-cus... so that we can pay individule attention to it.

Many thanks.

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.
Highlighted
One Star

Re: [resolved] save output in run-window to txt file

Hi,

 

I just came across this thread, I found this solution, which works perfectly for a single job.

 

Add the following code to a tJava at the beginning of your job. if you haven't created the log directory you can add tCreateTemporaryFile before the tJava and check the box "Remove file when execution is over". this will create the directory for you if you don't have it already.

 

java.io.File folder = new java.io.File("/var/");

java.io.File logFile = new java.io.File("/var/textLog.log");

java.io.PrintStream ps = new java.io.PrintStream(new java.io.FileOutputStream(logFile));
System.setOut(ps);
System.setErr(ps);

Highlighted
Moderator

Re: [resolved] save output in run-window to txt file

Hello fatemeh.behfar,

Thanks for sharing your solution with us.

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.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog