Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Hi All
Can I save output in run-window to txt file ?
Try to do it through Stats&logs settings
but only statistics gathered (may be also log)
2012-10-05 18:10:28;TCd7dK;TCd7dK;TCd7dK;6132;THINKBI_DEV;j_java01;_b-_1UA4iEeKoMfxGjj3v1A;0.1;Default;;begin;;
and I need full output
including logrow and print in java

Labels (2)
37 Replies
_AnonymousUser
Specialist III
Specialist III

Thank you Shong
Anonymous
Not applicable
Author

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. 

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

Hello,

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

Best regards

Sabrina

 

Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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

fbehfar
Contributor
Contributor

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);

Anonymous
Not applicable
Author

Hello ,

Thanks for sharing your solution with us.

Best regards

Sabrina