Many times you need to get log details on external files which Talend is not able to redirect or catch using standard Log management, but you know many times error displays on Talend run console but is not caught in error connector. so here is sample code which you can use in your job to redirect error or run console messages to file.
just at the beginning of you job place tJava, and inside a tjava, redirect globally the standard output… insert this code (add buffering if you need):
————————-
java.io.File file = new java.io.File(“/temp/mylogfile_test.txt”);
java.io.PrintStream ps = new java.io.PrintStream(new java.io.FileOutputStream(file));
System.setOut(ps);
————————-
much useful
Umesh, I am a big fan of your articles since I am a newbie to Talend. I am struggling to come up with a solution where I have one centralize Error job to capture the errors of any other jobs. So if my Job A, Job B or Job C throws the error/s it will be picked up by Error Job. I have gone through different posts but no luck as of now. I am in urgent need of such a solution.
Thanks
Austin
Thank You Austin!
You can create one ERROR_JOB, which will use error capture component to catch the errors and move to file/db table. then just drag and drop this(ERROR_JOB) to Job A, B and C to capture the errors. soon i will post the entire workflow.
Thank you
Umesh