1 May 2008 08:09
Re: Ant, log4j: Defining log file path with ant properties
Jacob Kjome <hoju <at> visi.com>
2008-05-01 06:09:46 GMT
2008-05-01 06:09:46 GMT
Sure, are you wanting logs for unit tests or something? Then just define a system
property to set inside the junit task....
<junit ....>
<sysproperty key="log.file"
value="${dir}/log/build.log"/>
</junit>
Jake
Friedbert Widmann wrote:
> Is it possible, to overwrite the path of the logfile with properties set within
> the project build file.
>
> Example: I want to define a target like the following:
> <target name="init">
> <mkdir dir="${dir}/log" />
> <property key="log.file" value="${dir}/log/build.log" />
> <magic> reopen log4j logfiles </magic>
> </target>
> It defines a project specific directory for the logfiles and should overwrite
> the definitions in log4j.properties.
> The log4j.properties should look like:
> log4j.rootLogger=INFO, LogFile
> log4j.appender.LogFile.File=${log.file}
>
> Mit freundlichen Grüßen, / With best regards,
> Friedbert Widmann
>
(Continue reading)
RSS Feed