0

Am using log4j as follows :

<appender name="LOGFILE" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="File" value="D:/direc/logs/back-${batch}-${dateexec}.log" />
    <param name="DatePattern" value="'.'yyyy-MM-dd-HH" />

    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern"
            value="%d{dd MMM yyyy - HH:mm:ss,SSS} [%t] %-5p [%c] %M : (ligne %L) - %m %n" />
    </layout>
</appender>

where {batch} and {dateexec} should refer to variables[from command parameters ] (batch name and execution time).

in this case the log file name is "back--.log"

Does any one knows how it works ?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
ProXamer
  • 377
  • 1
  • 9
  • 25
  • possible duplicate of [How to give environmental variable path for file appender in configuration file in log4j](http://stackoverflow.com/questions/13066042/how-to-give-environmental-variable-path-for-file-appender-in-configuration-file) – Seelenvirtuose Nov 11 '14 at 08:59
  • @Seelenvirtuose : am willing to obtain those variables beeing specific to the batch itself. may be getting it from its own parameters – ProXamer Nov 11 '14 at 09:13

0 Answers0