Talend中的常见日志[英] Common Logging in Talend

本文是小编为大家收集整理的关于Talend中的常见日志的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我试图在talend中实施登录.因此,我使用普通组件做了一份工作,我通过Twarn和TDIE记录了错误,信息和调试. 使用logcatcher,我将日志隔离为调试和错误的两个文件. 这部分工作正常.

现在我完成了两个工作,

首先: - 使用trowgenerator生成线,然后发送到tmap并从TMAP发送,我将根据某种条件发送到两个Twarn组件.

第二: - 具有tlogcatcher,t_filterrow并根据某种条件分离到两个文件的作业.

所以我正在与第一个捕获日志的工作并行运行第二个作业,但它不起作用.

我尝试了几个选项,并在这一点上卡住.

主要想法是拥有一个通用的记录组件,可以插入日志的任何作业.

有什么方法可以实现?

推荐答案

以下是弹出的三种方式:

log4j:企业版本内置了log4j,这意味着您可以在twarn/tdie中设置调试级别,并配置log4j将这些放置在不同的文件中. (当使用它时,我发现最好将警告作为我自己的信息级记录,因为Talends信息级别太深了.) 我敢肯定,log4j也可以成为开放式工作室的"黑客攻击".那将解决您的问题. https://exchange.talend.com 在搜索log4j时有很多结果,您应该看看./p>

大麻:如果您喜欢当前的方式,我会为您看到2个选项.首先是尝试创建软糖,但是使用来自多个作业的同一文件不是一个好主意,可能会导致错误.这不是一个不错的解决方案,但是如果我们只谈论需要生成2个文件的1个作业,则可以工作.

项目级记录:您可以尝试启用项目级记录,但可以将所有内容记录到文件中.这基本上意味着将LogCatcher输出重定向到文件.多数民众赞成在1个文件不是2,但至少它有效. /2.6+自定义+项目+设置(统计和日志)

确实没有很好的解决方案.

其他推荐答案

talend具有内置的日志记录,并且非常易于设置.步骤1:创建AMC数据库.步骤2.设置用于记录的项目级别属性.步骤3.检查AMC数据库中的日志.所有错误和Twarns都将被记录.可选步骤4:基于AMC数据库中的日志数据创建报告.

您可以登录文件而不是DB,但是登录到DB可以允许更强大的查询和报告.另外,如果您从TAC中运行工作,则可以将AMC加入TAC DB,以获取有关您的工作的一些非常有用的报告.

您可以记录:

  • 错误和警告
  • Stats(工作持续时间)
  • 流量计(数据流量指标)

屏幕1在talend Studio中显示项目设置

在此处输入图像说明

屏幕2显示了AMC DB,日志表的查询.请注意,还有另外两个表,一个用于统计数据,另一个用于流程.另外,请注意在选择的行中,有来自Twarn的消息.

在此处输入图像说明

其他推荐答案

感谢所有人的扩展支持.我能够实现自己想要实现的目标.

我创建了一个标准作业,这给了Twarn和tdie日志. 然后,我有一个软玻璃,可以根据错误或信息/调试来捕获日志并分发日志.

本文地址:https://www.itbaoku.cn/post/1873064.html

问题描述

I was trying to implement logging in Talend. So I made a job using normal components, I have recorded the error, info and debug through Twarn and Tdie. Using Logcatcher , I am segregating the log into two files of debug and error. This part is working fine.

Now I have made two jobs,

First:- Using trowgenerator generating lines, then sending to tmap and from tmap, I am sending to two twarn components based on some condition.

Second:- A job which has tlogcatcher, t_filterrow and segregating to two files based on some condition.

So I am running the second job in parallel with the first job to capture the logs, but it is not working.

I have tried several options and stuck at this point.

Main idea is to have a common logging component which can be plugged to any job for the logs.

Is there any ways with which it can be achieved ?

推荐答案

Here are the 3 ways that popped in:

log4j: Enterprise version has log4j built in, which means you can set a debug level in tWarn/tDie and configure log4j to put these into different files. (When using it I found it best to have the warnings as my own info level log, since talends info level is too deep.) I'm sure log4j can be an "hacked" into open studio as well. That would solve your problem. https://exchange.talend.com has many results when searching for log4j, you should take a look.

joblet: If you prefer your current way I see 2 options, for you. First is to try and do create a joblet, however using the same file from multiple jobs is not a good idea and probably results in errors. This is not a nice solution but could work if we only talk about 1 job that needs to produce 2 files.

Project level logging: You can try to enable project level logging but that logs everything into files. It basically means redirect the logcatcher output to a file. Thats 1 file not 2, but at least it works. https://help.talend.com/display/TalendOpenStudioforBigDataUserGuide520EN/2.6+Customizing+project+settings (Stats & Logs)

There really is no nice solution to what you need.

其他推荐答案

Talend has built-in logging available and its very easy to setup. Step 1: create AMC database. Step 2. Set project level properties for logging. Step 3. check AMC database for logs. All errors and tWarns will be logged. Optional Step 4: create reports based on logging data in the AMC database.

You can log to file instead of db, but logging to db allows more robust query and reporting. Also if you run jobs out of the TAC you can join AMC to the TAC db for some really useful reports on your jobs.

You can log:

  • Errors and Warnings
  • Stats (job duration)
  • FlowMeter (data flow metrics)

Screen 1 shows project setup in Talend Studio

enter image description here

Screen 2 shows a query from the AMC db, log table. notice there are two other tables, one for stats, and another for flow. also notice in the row selected there is message from a tWarn.

enter image description here

其他推荐答案

Thanks all for the extended support. I was able to achieve what i was trying to achieve.

I have created a standard job, which is giving twarn and tdie logs. Then I have a joblet which catches the logs and distributes the logs based on error or info/debug.