From Thursday, July, 9, 3:00 PM Pacific,
our Community site will be in
read-only mode
through Sunday, July 12th.
Thank you for your patience.

Is there a way to use the log4j Talend instance to log in the Jobs?


Which log4j logger instance should be used to log inside a Job?



The tJava component allows you to use the existing log instance of the Job, for example:


log.debug("DEBUG: Hello World");"INFO: Hello World");
log.warn("WARN: Hello World");
log.error("ERROR: Hello World");
Version history
Revision #:
6 of 6
Last update:
‎04-04-2019 01:30 AM
Updated by:
Six Stars

Using Talend Open Studio 6.3.0, I get the compilation error:


At least job "Test_Log4j" has a compile errors, please fix and export again.
Error Line: 1446
Detail Message: log cannot be resolved


when using tJava component and"INFO: job started");




Hello @tale103108 ,

Are you using a log4j component to create your logger object? You will look at the generated code to get the name of the object. once you have the object, you can send log messages to it directly in code by:
<logger_name>.info("this is an info message"); 

Best regards


Six Stars
I am using Talend Open Studio 6.3.0.

Are there log4j components in the free version? If so, what are they called?


Hello @tale103108,

Talend Open Studio doesn't have option to enable log4j logging, however, there are some custom component which can be used to enable log4j.

Best regards