How to send mail for start/end of job execution along with any failure with attached log file for error.

Six Stars

How to send mail for start/end of job execution along with any failure with attached log file for error.

Hi Team,

 

We would like to send mail for start / end for data processing where we have parent job with multiple child job. In case of any point of error, we need to send mail with attached log to identify the issue.

 

Please suggest the approach with any challenges or prerequisite to do this.

FYI, we are maintaining the error log using tredirect component so, need approach add the file in the failure case.

 

We are using TOS.

Twelve Stars

Re: How to send mail for start/end of job execution along with any failure with attached log file for error.

you may use a master job who send email and logs if fail.
use trunjob to run your job us on subjob erre to get failure.
but if job fail for hier problem !....

the second way is to keep logs and manage warning on it,
Talend Administration Center is made for That.

good luck

Francois Denis

Tag as "solved" for others! Kudos to thanks!

Six Stars

Re: How to send mail for start/end of job execution along with any failure with attached log file for error.

Thanks for your reply.

 

So, if I understand you correctly, we should have tsendmail job at the beginning and end of master job to send Start and end mail. And to handle the failure mail scenario, we should add tsendmail to all the trunjob with trigger on "run on Subjob error" isn't? Please confirm.

Twelve Stars

Re: How to send mail for start/end of job execution along with any failure with attached log file for error.

something like that. ( if you are using the free version. )

the real question is: what type of error do you want to catch, java exception error, operating ones, system errors, and what is the process in case of error.

Francois Denis

Tag as "solved" for others! Kudos to thanks!

Six Stars

Re: How to send mail for start/end of job execution along with any failure with attached log file for error.

We are catching all type of error directly by redirecting the console output in a file using redirectoutput component. Now with that file location and file name , I hope we can attach/send the mail in case of component error.

I hope this will work.

Six Stars

Re: How to send mail for start/end of job execution along with any failure with attached log file for error.

You can also use a tLogCatcher component linked to a tSendMail component. Populate the message portion with string labels and the relevant fields from tLogCatcher (like "project: "+row1.project). Make sure you edit the Job Settings>Stats & Logs portion of your project properties to include logs. You can put one of these subjobs in your parent job and each of your child jobs.

 

Edit - just noticed your file requirement. You can add that as an attachment in the tSendMail.

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch 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

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog