FileLoggerBase and XmlLogger

In order to demonstrate a realistic logger that doesn’t extend ConsoleLogger, I will show you the XmlLogger. The full source for this logger is available at my open source MSBuild project, codeplex.com/sedodream, as well as in the samples provided with this text. By default, MSBuild will create a text-based log, but if you are going to feed this log to other applications for processing or presentation it might be easier if you had an XML-based log. Since one doesn’t ship with MSBuild, you can write your own. In this section we will do just that.

Before we get into the implementation of the XmlLogger take a look at the output from the logger shown next. The command executed from the Examples.Loggers\bin\Debug\ directory ...

Get Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.