How to give dynamic file name in the appender in log4j.xml

Posted by Bittu on Stack Overflow See other posts from Stack Overflow or by Bittu
Published on 2010-05-11T13:11:24Z Indexed on 2010/05/11 13:14 UTC
Read the original article Hit count: 314

Filed under:
|

Hi I am using log4j.xml to log the informations. I have used log4j.xml file for creating the log files. I have given the absolute path for each log file in param tag value.

eg :

appender name="FA" class="org.apache.log4j.DailyRollingFileAppender"> param name="DatePattern" value="'_'yyyyMMdd"/> param name="File" value="D:/logFiles/GPreprocessor.log"/> layout class="com.dnb.genericpreprocessor.common.log.AppXMLLayout"/> /appender>

I do not want to give "GPreprocessor.log" directly.Actually that file name is dynamic based on my project. However the location will always remain same as "D:/logFiles/" . Please help me in this as this is very urgent and important for me.

© Stack Overflow or respective owner

Related posts about log4j

Related posts about dynamic-data