Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Xml logging problem (https://www.kinook.com/Forum/showthread.php?t=938)

Andrew 03-04-2005 08:22 AM

Xml logging problem
 
Our build procedure consists off one master build file that will call child build files when needed. The logging is turned on and set to XML type. We would like to log to one file instead of one log file per build file.

Everything works ok but when a call is made from a build file to a child build file the logging gets confused. As you can see the step Steps calls a child project file. And the log continues to log messages. The problem is that no closeing tag is added for the entry.

Is my assesment correct? If so how can I fix this?


Code:


        Steps
       

        \\SRVTCMT001\Build$\Installation\VisualBuildPro\steps.bld

        Step initialize
Completed


kinook 03-04-2005 08:39 AM

1 Attachment(s)
You should get a valid XML document with nested build elements and all closing tags. Testing here, I configured VBP to log globally to %TEMP%\test.xml (at Tools | Application Options | Logging), then opened the Chain.bld sample, unchecked all steps except the first one, built the project, and got the attached xml log file. Do you get the same behavior? Which version of VBP are you running?

Andrew 03-07-2005 08:16 AM

It seemed I was changeing the log in the very first steps, and it was writing the heading to the old log file instead of the new one.

The chain sample worked like it should work.

I've solved this now but I stumbled on another problem. I now build to a buildxml.log and delete this log file efore I start building.

When an error occures during on a step, within a group. I call a global error handeling function. This will copy the buildxml.log file to a new logfile yyyymmdd_hhmm.xml.

Next I call a transform XML log but this always fails with the error:

Code:

Error at line 6, position 3 loading 'C:\DOCUME~1\Build\LOCALS~1\Temp\bldB18.tmp': End tag 'step' does not match the start tag 'build'.
I have to option close input log file xml tags checked

PS: I'm using vbp 5.7

kinook 03-07-2005 09:11 AM

See the Logging.bld sample for how to delete the log file at the start of a build (must be done from the vbld_BuildStarting event [this fires before the log file is written to]). You could do something similar to change the log filename (by assigning a LOGFILE temp macro) there if necessary.

On the 2nd issue, please post or send to support@kinook.com a reproducible test case demonstrating the problem. Thanks.

Andrew 03-10-2005 04:16 AM

I've since found the problem and it's due to the way the log file is created.

When an error occures, the vbp project was trying to mail the logfile. The trouble is that these steps are also logged (this can be turned of like in the logging sample). And this would result in steps that are not closed correctly.

On top of this I was switching to a diffrent log file to log only a few steps. I guess I was confusing myself here.

kinook 03-10-2005 07:29 AM

To send the log file from a build, use a Transform XML Log step (before the Send Mail step). If you clear out the stylesheet field, it will just copy the log file and close any missing tags on the copy. Then send the output file from that step instead of the actual logfile itself (whose tags won't get closed until the build has actually completed). This is also demonstrated in the Logging.bld sample.

Andrew 03-10-2005 07:33 AM

Thanks for the anwser, and I discoverd this myself. The trouble is that the last few steps that come after the logging are (naturally) not logged and the logfile isn't finished.

So I decided to send the log after the complete build has run.


All times are GMT -5. The time now is 01:24 AM.


Copyright © 1999-2023 Kinook Software, Inc.