Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Logging in Talend.

Hi,
I'm currently using tLogCatcher to catch errors to file. I want to be use log4j to create logs because I want to be able to rotate the log.
I've looked into using tLog4J but I can't seem to understand how to use it and define a properties file for it. Can tLogCatcher in some combination be used to rotate log? how can I use tLog4J for this?
Labels (2)
9 Replies
Anonymous
Not applicable
Author

Hi
tLog4j should be used with tLog4jCatcher and tInitLog4j together, here is an example job shared by bcourtine on Talend exchange.
http://www.talendforge.org/exchange/index.php?eid=214&product=tos&action=view&nav=1,1,1

Best regard
Shong
Anonymous
Not applicable
Author

There is components in 4.2.2. the tLog4J is self contained.
Anonymous
Not applicable
Author

Hi, can any one tell me the path to file where the logs are located when we use tlog4j component?
Anonymous
Not applicable
Author

Hi
The path of logs file is defined in the log4j.xml file, and you need to specify the path of log4j.xml file on the tInitLog4j component.
	<appender name="DailyFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="File" value="d:/file/test/logs_test.log"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p %c{2} - %m%n"/>
</layout>
</appender>

You can find an example job that using log4j components on Talend Exchange.
http://www.talendforge.org/exchange/index.php?eid=214&product=tos&action=view&nav=1,1,1
Shong
clubiste84
Contributor II
Contributor II

hello,
 I work on version 5.5.1 and I am using the component tlog4j but I do not know how to download ?
thank you for your help

Anonymous
Not applicable
Author

hello,
 I work on version 5.5.1 and I am using the component tlog4j but I do not know how to download ?
thank you for your help



Please read this KB article how to install a custom component into Talend Studio.
Best regards
Shong
orawajar
Contributor III
Contributor III

tLog4j working fine when i run my job from Talend, but it not work when i call my job from eclipse. do you have any clue?
Anonymous
Not applicable
Author

you have to create web project and add configuration of log4j into web.xml as following
<!-- LOG4J Configuration -->
    <context-param>
        <param-name>log4jConfigLocation</param-name>
<!-- Specify path of log4j properties -->
        <param-value>file:${automation.prop.folder}/TALEND_PROPERTIES/log4j.xml</param-value>
    </context-param>
    <listener>
        <listener-class>
            org.springframework.web.util.IntrospectorCleanupListener 
        </listener-class>
    </listener>
    <listener>
        <listener-class>
            org.springframework.web.util.Log4jConfigListener
        </listener-class>
    </listener>
    <!-- //LOG4J Configuration -->
_AnonymousUser
Specialist III
Specialist III

Hello Ppl,
can we change the log4j.xml file to get the Error log output in a file instead of console ?
If Yes, could you please tell me how.

Thanks,
Abhijit