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

Four Stars

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,
Moderator

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

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
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

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

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