views:

529

answers:

1

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.

A: 

Please check the following link:

http://cognitivecache.blogspot.com/2008/08/log4j-writing-to-dynamic-log-file-for.html

Petr

related questions