Search code examples
talend

Talend tLogCatcher emits all fields null in tJava


enter image description here

I want to send all Java errors of my Talend flow, to a Slack channel. Therefore I'm using a tLogCatcher as an independent component inside my flow. When an error occurs, I see all error fields in a tLogRow component like that:

.-------------------+------+--------+----------+-----------------+------------+-------+--------+--------------+----------------------+--------------------------------------------------------------------------------------------------+----.
|                                                                                                                 tLogRow_2                                                                                                                  |
|=------------------+------+--------+----------+-----------------+------------+-------+--------+--------------+----------------------+--------------------------------------------------------------------------------------------------+---=|
|moment             |pid   |root_pid|father_pid|project          |job         |context|priority|type          |origin                |message                                                                                           |code|
|=------------------+------+--------+----------+-----------------+------------+-------+--------+--------------+----------------------+--------------------------------------------------------------------------------------------------+---=|
|2021-02-16 09:56:51|hasqZB|hasqZB  |hasqZB    |PREPROCESSOR_DATA|rf_dwh_kunde|Default|6       |Java Exception|tFileInputProperties_1|java.io.FileNotFoundException:\conf\config.cfg (Das System kann den angegebenen Pfad nicht finden)|1   |
'-------------------+------+--------+----------+-----------------+------------+-------+--------+--------------+----------------------+--------------------------------------------------------------------------------------------------+----'

When I add an additional tJava object after the tLogRow and simply try to print the object like this

System.out.println(row4);

I get the following result

preprocessor_data.rf_dwh_kunde_0_1.rf_dwh_kunde$row3Struct@6767c1fc[moment=null,pid=null,root_pid=null,father_pid=null,project=null,job=null,context=null,priority=null,type=null,origin=null,message=null,code=null]
.

where all fields (moment, pid, origin, etc.) are suddenly "null".

Any idea why that is the case?

I already tried appending the tJava directly to the tCatchLog, result is the same. Watched some tutorials on YouTube, supposing it should work like that.


Solution

  • Use tJavaRow instead of tJava and it works.