How to pass context variables to log4j.xml in talend?

Six Stars

How to pass context variables to log4j.xml in talend?

Hi Team,

please help me in how to call context variables from log4j.xml fie .

I have found log4j supports variable substitution as ${variableName}.

how can i call context variable to log4j.xml file in above syntax

 

Thanks,

Abhi529 

Sixteen Stars

Re: How to pass context variables to log4j.xml in talend?

I don't believe you can use context variables here. This is based on a response from Talend R&D from around 2015. However, this may have changed. @shong is this still the case?

Community Manager

Re: How to pass context variables to log4j.xml in talend?

Hi
I don't think it is possible to use context variable directly in log4j.xml file, maybe you need to reinitialize log4j on a tJava and use context variable.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Six Stars

Re: How to pass context variables to log4j.xml in talend?

Hi @shong,

 

Thank you for your answer.

could you please explain me "how to reinitialize log4j on a tJava and use context variable.

 

Thanks,

Abhi529