Yoav,

Thanks for the suggestion, but that doesn't work either.

So now I have:
<property name="installdir" value="${env.CATALINA_HOME}/webapps/MYAPP"/>


                 <target ...>
                   <filter token="INSTALLDIR" value="${installdir>/WEB_INF/>
                   <copy todir=${build}/WEB_INF/classes"
                          file="${basedir}/config/log4j.xml"
                     filtering="true"/>
                 </target>

And the generated log4j.xml file has the same mixed / & \ values.

Beyond that, I tried to manually change all the '/' to '\' in the generated log4j.xml file and when I ran it, it put the file under tomcat/bin and its name was the concatenation of all the path elements. I then tried to "escape" the backslash and that worked fine! This would sound like a problem with the xml parser log4j is using when it is parsing the "value" param and handing it to log4j.

Oddly enough, when I changed all the backslash's to forward-slash's, that worked too. I thought on a Windoze box, Java used the system-dependent filenaming conventions when creating a FileOutputStream (which is all that log4j does with the filename)?

So are you doing this currently on a windoze or *nix box? I can see how it would work in a non-M$ environment. Thoughts?

--- regards ---
Larry


At 12:39 PM 8/27/03 -0400, you wrote:


Howsdy,
Try
<filter token="token" value="value" />
outside a filterset. (i.e. no filterset at all, just the above line
above the <copy> task.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message----- >From: Larry Young [mailto:[EMAIL PROTECTED] >Sent: Wednesday, August 27, 2003 11:36 AM >To: Log4J Users List >Subject: RE: Location of log files > >Hello, > > This is a question about a post from several weeks ago. I wasn't >ready to try it at the time, but I saved it because I knew I'd need it >later on ... :) > > When I tried to use "filtering" as described in the original post >(actually, I created a "filterset" inside the copy tag), it works fine >except that on Windows 2K it contains back-slashes(\) from my >$CATALINA_HOME env variable and forward-slashes(/) from the subpath info >inside of Ant. Then, when log4j gets it, the backslashes are effectively >ignored (probably interpreted as "escaping" the next character) so log4j >complains that no such directory exists. > > Is there a way to get log4j to accept either path-separator >character, or alternately is anyone aware of an Ant function to force >"filtering" to use the platform-dependent path separator when replacing >text ?? > >My Ant build.xml looks basically like this: > > <property name="installdir" >value="${env.CATALINA_HOME}/webapps/MYAPP"/> > > <target ...> > <copy todir=${build}/WEB_INF/classes" > file="${basedir}/config/log4j.xml"> > <filterset> > <filter type="INSTALLDIR" value="${installdir>/WEB_INF/> > </filterset> > </copy> > </target> > >And my log4j.xml looks roughly like this: > > <appender name="XYZ" > class="... RollingFileApppender"> > <param name="file" value="@INSTALLDIR@/myapp.log/> > ..... > </appender> > >In the destination log4j.xml file, the value for the appender's "file" >param is "C:\Java\tomcat/webapps/MYAPP/WEB_INF/myapp.log". Any thoughts >??? > >--- regards --- >Larry > >

--------------------------
Larry Young
The Dalmatian Group
www.dalmatian.com




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



Reply via email to