Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Write to error log using redirect:write

Reply
Thread Tools

Write to error log using redirect:write

 
 
Petterson Mikael
Guest
Posts: n/a
 
      09-11-2006
Hi,

I am using xalan. In my stylesheet I have the following snippet to write
to std out when a specific error occurs.

<xsl:template name="class_error">
<xslaram name="class"/>
<xslaram name="attribute"/>
<xslaram name="error_msg"/>
<xsl:message terminate="no">
Class:<xsl:value-of select="$class"/>
Attribute:<xsl:value-of select="$attribute"/>
Error:<xsl:value-of select="$error_msg"/>
</xsl:message>
</xsl:template>

I want to collcet all these class errors in a file. I have tested to
create an error.log in my outputdirectory using

> <xsl:template name="class_error">
> <xslaram name="class"/>
> <xslaram name="attribute"/>
> <xslaram name="error_msg"/>
> <redirect:write file="{$output.dir}/{$error.log}" append="true">
> Class:<xsl:value-of select="$class"/>
> Attribute:<xsl:value-of select="$attribute"/>
> Error:<xsl:value-of select="$error_msg"/>
> </redirect:write>
> <redirect:close file="{$output.dir}/{$error.log}"/>
> <xsl:message terminate="no">
> Class:<xsl:value-of select="$class"/>
> Attribute:<xsl:value-of select="$attribute"/>
> Error:<xsl:value-of select="$error_msg"/>
> </xsl:message>
>
> </xsl:template>



But there is not error.log file created there. What am I missing or is
there a better way to do it?

cheers,

//mikael
 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      09-11-2006
Petterson Mikael wrote:
>> <redirect:write file="{$output.dir}/{$error.log}" append="true">

> But there is not error.log file created there. What am I missing or is
> there a better way to do it?


Stupid question, just to get it out of the way: You didn't show us what
you set those variables to. Are they initialized correctly and in scope
at this point in the stylesheet?


--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log independently of other webapps using log4j? Also, reading from log file from within servlet? unomystEz Java 0 11-19-2006 10:42 AM
ASP Problem: "IIS log failed to write entry" in Event Log cherryparadise001@gmail.com ASP General 0 05-26-2006 01:52 AM
write error message to a log file while processing the ftp command Jing Perl Misc 3 12-06-2004 09:00 PM
Event Log Write Access error. bms ASP .Net Security 3 05-12-2004 01:51 AM
Custom Event Log Write Error TJO ASP .Net Security 2 11-28-2003 07:25 PM



Advertisments