Talend通过电子邮件发送日志输出

时间:2017-02-03 08:03:06

标签: talend

我在Talend有一份工作,在电子邮件中获取日志的部分是这样的:

tLogCatcher - >主要 - > tJavaRow

I

onComponentOk - > tSendEmail

我的观点是,我想将日志的输出发送到电子邮件以获得通知。

我在tJavaRow中使用:

globalMap.put("errorCode", input_row.message);

并在tSendEmail中:

"Hello, 
The input message is" +  (String)globalMap.get("errorCode")

但是,(String)globalMap.get(" errorCode")部分始终返回null,而错误消息则不同。

你知道为什么会这样吗? 非常感谢!

1 个答案:

答案 0 :(得分:3)

您可以将tLogCatcher连接到tSendMail

enter image description here

在tSendMail中你可以这样说:

"Hello, The input message is" + ((String)globalMap.get("tLogCatcher_1_ERROR_MESSAGE"))

显然,如果没有错误或警告,您将获得null,因此您需要将tWarn或tDie添加到您的工作中,或者只是将其设置为错误。

相关问题