Log4j2 Configuration for TOS DI

One Star

Log4j2 Configuration for TOS DI

Hi,
We are using TOS DI v5.5.1. I have the following two questions regarding Log4j related configurations:
(1) Log4j configuration: 'https://help.talend.com/pages/viewpage.action?pageId=207421454' states ${TalendJob.log} as a dynamic file name variable. But, using this variable is creating a file as 'jobName.log' in the specified folder, say, D:/ if D:/${TalendJob.log} is specified in the log4j.xml file. How to specify a dynamic value for the folder as well as the log file name in the xml file? For example, if there is a context parameter by name 'log_file' (say it contains a user specified path+file name like C:/mytalend/myproject/mylog.log). Note: I am able to use JVM argument and set the variable name. I would like to know if this is possible through a context variable.
(2) Log4j2 configuration: Is it possible to configure TOS DI v5.5.1 for Log4j2 logging in JSON format?
Please help.
Thanks,
Sudha
Community Manager

Re: Log4j2 Configuration for TOS DI

Hi 
I have consulted to our developer and was told that it uses log4j to capture the log message and it doesn't support context variable.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Log4j2 Configuration for TOS DI

Shong,
I am using the ${TalendJob.log} and it works fine. It creates a log file with the Talend's job name.
Shuba
Six Stars

Re: Log4j2 Configuration for TOS DI

Yes, I can also confirm that it supports dynamic variables in 5.4.1 EE version to be used in conjunction with log4j.
Log4j2 is another story, I think this is not supported in the moment and will require recompilation of Talend OS edition, in case of EE, is there any plan to support version 2 of log4j?
Six Stars

Re: Log4j2 Configuration for TOS DI