Any ideas for filtering logs?

Hi,

We use Visual Studio .NET for building.  When a build fails, I'd like to email the build log (or a link to the html build log) to the development team.  However, I'd like to filter out everything except the VS.NET part of the log (so users don't have to dig through all of the FB output).

Any suggestions on how to do this?

Thanks.

Hi Mike,

Thanks for posting. There are a few ways you could do this. Here are three suggestions:

1) The Export Log action has an "Export only Error Actions" option which will probably cut down the number of actions exported in the log.

2) If it's just a single action, you can use the "Log Output to Variable" option to log to a variable, and then include that variable in the body of the email.

3) If neither of these two are flexible enough, you can use XSLT to extract just the output from Visual Studio actions. Let me know if you'd like to see an example of this.

Regards,

Angus

Other option for you - I have a Ruby script that I use as the final step of our build proces to parse out lines containing keywords and save it to a seperate log file.  After the parsing is done I have FB email the log to me. 

I've been meaning to blog about it for some time, so if there is interest I can see about getting it to my website and posting the link here once I get done converting it to work with FB5 output.

- Rich Werning

All of these ideas sounds good. I will try the “Log Output to Variable” method and see how that works. If you happen to have an XSLT example handy, I would like to see it.

Thanks,
Mike

Hi Mike,

I did put together something similar a year or so ago, I’ll see if I can find it for you.

Regards,

Angus

IMHO, the “log output to variable” is very powerful. I only discovered it recently. But you can do great constructs like:


try
VS.net build whatever (log to X)
VS.net build whatever (log to X)
VS.net build whatever (log to X)
catch
email X to someone
end

So you end up with X containing only the output from the variable that failed. The possible pitfall though is that if the build fails in a surprising way you can end up with a misleading log message, so it might be best to clear X after each build step if it succeeds.

You could also send the buildlog.htm’s that VS.net automatically produces…

Steve

I did try using the “log output to variable” method and it worked well, gave me exactly what I wanted. One question – is the “content” of an action list variable cleared each time before it is written to, or is the content maintained for the duration of the action list? I found that in order to get the results I was looking for, I had to write to my log file after each time I did a “log output to variable”.

Hi Mike,

Each time you do a “log to variable” the contents of the variable will be overwritten.

If you need to append variable contents to each other, there is an Append Variable action. However, Steve’s suggestion (always logging to the same variable, so if there is an error you only have output from the one single action that failed) is probably worth considering as well.

Regards,

Angus