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)
and I need full output
including logrow and print in java
Logrow? The message printed by tLogRow component? If so, you can use tFileOutputDelimited instead of tLogRow to output the result into file.
if your running the job on a linux machine you could edit the shellscripts that runs the job to write all messages on the console into a .txt file?
java -Xms256M -Xmx256M -cp classpath.jar: repo.jbname.jbname --context=Default "$@" > /consoleoutput/example.txt
I understand you now. But it is impossible to log all the message printed on the console to a file. If the log message captured by tStatCatcher does not meet your need. Usually, we customize the log message with tFixedFlowInput and append them into an existing log file. such as "The job begin to run, the start time is:"+TalendDate.getCurrentDate()
Sorry for bring this topic up, but in fact I had same issue in the past and I wrote a component that does the trick.
It allows you to redirect all the output from System.out and/or System.err to files on disk.
Check it here:
the job starts at: 2013-05-04 17:02:43
the job starts at: 2013-05-04 17:02:43
Exception in component tFileInputDelimited_1
java.lang.NumberFormatException: For input string: "a"
To achieve your needs we would require a new component, It may be possible
but it would work a little bit different than what you want. The redirection of outputs
can only be done to Streams, not to Variables. In this case we would need to open a
memory stream and expose some fake Talend variables in the component for you to
get the content logged so far.
To achieve what you need I strongly suggest to write a "top" job and put the main
logic inside a subjob. This subjob would use the component to redirect the output to a
file. Then you read the file in the top job, after returning from subjob, and email the
result. This way you avoid access problems trying to read the stream while the program
could be trying to write to it. This is the way I use this component to notify my team of
errors in ETL jobs with this component.
Hope this can help you.
Glad to see you come back to your topic near one year later.
This component is not included in Talend now, but I agree with you that this component is very useful, we will consider to add it to Talend components family in future.
I am sure this component do also works in v5.3.1, brazabr don't update the extension on Talend Exchange yet.
I'm trying to use 'tRedirectOutput' and it is not working fine for me. I can't redirect the "System.setOut" or "System.setError" to another file that is not the default configuration file defined in the component:
Exception in component tRedirectOutput_1
java.io.FileNotFoundException: /talend/opt/talend-jobs/ESPThunderheadBatchInput/C:/Talend/components/out (No such file or directory)
That path is defined in the component as "__COMP_DEFAULT_FILE_DIR__" and I'm trying to use a context variable that is being ignored.
Any idea? Any comment?
Btw: I'm using version 0.2 of the component.
I updated the component with the options suggested by Shong. Thank you man.
Feel free to suggest other additions if you think it may help others.
You can download it here:
Check attached image for the new options.
I am new in the Forum. I downloaded tRedirectOutput and saw, that the Component works only in a Job with console-outputs. If I have a parent job without outputs and subjobs with outputs, than I couldn't use the Component from the parent job. Is it so? Have you experiences?
Join us at the Community Lounge.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Pick up some tips and tricks with Context Variables
Learn how media organizations have achieved success with Data Integration
Test drive Talend's enterprise products.