Howdy,
Good question.  I don't know the answer, as I have "hard-coded"
properties file for development, staging, testing, production, etc.
(build.properties files), and then it's much simpler.  I do this because
I intensely dislike making any aspect of build or deployment dependent
on environment variables.  If you still want to pursue this route, I
suggest asking on the ant-user list how to escape properties.  Something
like an in-memory FixCRLF task.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Wendy Smoak [mailto:[EMAIL PROTECTED]
>Sent: Monday, January 05, 2004 1:30 PM
>To: [EMAIL PROTECTED]
>Subject: Help with replacing tokens for log file name
>
>
>I'm not sure whether this is more Ant or Log4j, so please send me along
>if I'm not in the right place.
>
>In build.xml, I have this:
>   <target name="props-dev" depends="copy-props">
>     <replace file="${propsdir}/log4j.properties"
>                token="@logFileName@"
>                value="${env.TOMCAT_HOME}\logs\${context}.log"/>
>   </target>
>
>It's turning this in log4j.properties:
>   [EMAIL PROTECTED]@
>into this:
>
>log4j.appender.daily.File=c:\jakarta\jakarta-tomcat-4.1.29\logs\coldev.
l
>og
>
>Unfortunately, this results in log messages going to a file called
>   jakartajakarta-tomcat-4.1.29logscoldev.log
>in the c:\jakarta\jakarta-tomcat-4.1.29\bin directory.
>
>I tried quoting  @logFileName@ but that produced:
>log4j:ERROR setFile(null,true) call failed.
>java.io.FileNotFoundException:
>"c:jakartajakarta-tomcat-4.1.29logscoldev.log" (T
>he filename, directory name, or volume label syntax is incorrect)
>when the webapp is started.
>
>I think the answer is to escape the backslashes, but since part of it
>comes from a system property, I don't see how.
>
>Is there a way to do this on Windows?  I can just use a .properties
file
>for the token/value replacements, I was trying to avoid hard-coding as
>much as possible though.
>
>--
>Wendy Smoak
>Application Systems Analyst, Sr.
>ASU IA Information Resources Management
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to