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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
orawajar
Contributor III
Contributor III

tLog4j, tInitLog4j : How to set max size and file name pattern?

Hi Master,
i need to use log4j in TOS-DI and found component  tLog4j, tInitLog4j and tLog4JCatch.
i have downloaded the example : ExampleLog4j
In this example, the configuration is (in log4j.xml):
<appender name="DailyFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="DatePattern" value="'.'yyyy-MM-dd"/>
    <param name="File" value="/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>

if i want to set :
1. Max size of each log file is : 1Mb
2. Daily Rolling, if the date changed, it will create new log file
2. Log file name pattern : app_%d{yyyyMMdd}_%i.log (where i is sequential number if more than 1 log file created in a day).
How can i do this?
Thank you and best regards,
Labels (3)
2 Replies
Anonymous
Not applicable

Hi,
tLog4j, tInitLog4j, tLog4jCatch  are custom components developed by Talend Community user and shared on Talend Exchange.
You'd better contact to the author  bcourtine directly.
Best regards
Sabrina
orawajar
Contributor III
Contributor III
Author

Hi xdshi,
Thank you for you advice. i have sent him an email and still waiting for his response.