You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Diane Holt <ho...@yahoo.com> on 2002/06/11 00:56:30 UTC

Using XmlLogger as a logger

I get very different output when I use XmlLogger as a logger vs. when I
use it as a listener. I'm going to assume that's correct, but the next
question is: what do you do with the log file that it generates when used
as a logger? Trying to run <style> on that one, the way you do with the
listener-generated one doesn't work, so is there anything available that
does, or do you really need to run it as a listener in order to get the
pretty HTML page out of it?

Thanks,
Diane 


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using XmlLogger as a logger

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Diane Holt wrote:
> --- Erik Hatcher <ja...@ehatchersolutions.com> wrote:
> 
>>The good news it still works as a listener :)
> 
> 
> Yeah, but I've already got a listener attached, which is why I was trying
> to use it as a logger -- 'cause I don't think you can have two listeners
> at the same time, can you?
> 
Yes, you can - any number - just one logger

Conor



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using XmlLogger as a logger

Posted by Diane Holt <ho...@yahoo.com>.
--- Erik Hatcher <ja...@ehatchersolutions.com> wrote:
> The good news it still works as a listener :)

Yeah, but I've already got a listener attached, which is why I was trying
to use it as a logger -- 'cause I don't think you can have two listeners
at the same time, can you?

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using XmlLogger as a logger

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
The System.out.println for that "Buildfile:" line is before the Project
object is created and before the logger and listeners are added, so its not
really the XmlLogger that is doing the writing, its the output stream from
Main that is doing it.. *ugh* - interesting find, Diane.

Most definitely a bug.

Were you using -logfile in conjunction with XmlLogger?  I'm guessing yes.

Would you file this as a bug and I'll have a look at it at some point in the
near future.  The short answer is: don't use it as a logger at the moment.
:/  Sorry.

Its very likely that in my tests with this that I never verified that the
XML output was "well formed" and simply typed the output to make sure it was
following the verbosity level rules, and I overlooked the "Buildfile:" line.
*arg*.  I'm not quite sure what the solution to this is, since the XmlLogger
is writing to a file that has already been written to beyond its control.
Anyway, I'll try to look into this soon.  The good news it still works as a
listener :)  And to get the output to a file, simply do this:

        ant -listener
org.apache.tools.ant.XmlLogger -DXmlLogger.file=log.xml

    Erik


----- Original Message -----
From: "Diane Holt" <ho...@yahoo.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Monday, June 10, 2002 7:05 PM
Subject: Re: Using XmlLogger as a logger


> Oops, here's the problem -- it's not that the output is completely
> different (once you grep out all those "<message priority...>" lines),
> it's that the "Buildfile build.xml" line gets included in the log.xml
> file.
>
> $ cat log.xml
> Buildfile: build.xml
> <?xml version="1.0" encoding="UTF-8" ?>
> <?xml-stylesheet type="text/xsl" href="log.xsl"?>
>
> [snip]
>
> Once I got rid of that, log.xsl worked on it.
>
> Diane
>
> =====
> (holtdl@yahoo.com)
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using XmlLogger as a logger

Posted by Diane Holt <ho...@yahoo.com>.
Oops, here's the problem -- it's not that the output is completely
different (once you grep out all those "<message priority...>" lines),
it's that the "Buildfile build.xml" line gets included in the log.xml
file.

$ cat log.xml
Buildfile: build.xml
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="log.xsl"?>

[snip]

Once I got rid of that, log.xsl worked on it.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>