Reputation: 6281
I have a tLogRow component that logs the output of tSetGlobalVar and tContextDump. I have exported the job, and in the zip file I found a log4j which makes me think it is using this for the tLogRow component. Now, my question is how can I specify the log level for the tLogRow component? as I'll be only wanting to see its log on WARN or maybe DEBUG level.
And for my tLogRow component I have checked "Print content with log4j".
Thank you in advance!
Upvotes: 1
Views: 2982
Reputation: 6281
As @54l3d mentioned above, tLogRow
component seems not be the ideal component for logging using log4j. I have achieved this via tJava instead:
org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(this.getClass());
logger.debug("MY_CONTEXT_NAME: " + context.MY_CONTEXT_NAME);
logger.debug("GLOBAL MAP paramA: " + globalMap.get("paramA"));
For the globalMap's values logging, please note that if the your tJava component that's performing the log is within the same subjob as the tSetGlobalVar
, the value you have set will not be immediately reflected. I was only able to log the values set when it is on a different subjob than tSetGlobalVar
.
Upvotes: 1
Reputation: 3973
This is not the use case of tLogRow component, its just to dislay a flow to console. The check box of using log4j
does not change the content of the output, its about to change the api of writing. To change the settings of log4j
in Talend, you can go to the top left of screen, the menu file
then edit the project properties
and you find this screen :
Upvotes: 1