#1
|
|||
|
|||
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 <build> entry. Is my assesment correct? If so how can I fix this? Code:
<step action='VisBuildPro Project' type='0' start='4/03/2005 13:57:48'> <name>Steps</name> <build context='GUI' start='4/03/2005 13:57:50'> <name>\\SRVTCMT001\Build$\Installation\VisualBuildPro\steps.bld</name> <step action='Group' type='0' start='4/03/2005 13:57:52'> <name>Step initialize</name> <status code='0'>Completed</status> </step> |
#2
|
|||
|
|||
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?
|
#3
|
|||
|
|||
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'. PS: I'm using vbp 5.7 |
#4
|
|||
|
|||
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. |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
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.
|
#7
|
|||
|
|||
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. |
|
|