Multiple loggers on the command line

I'm trying to log to both the standard FileLogger and the Kobush XML logger. Now the documentation states:

/logger:logger

Specifies the logger to use to log events from MSBuild. To specify multiple loggers, specify each logger separately.

For some reason I cannot seem to specify multiple loggers. If I use this command line:

msbuild.exe /t:Build /property:Configuration=Debug /property:BuildShell=PSH /l:FileLogger,Microsoft.Build.
Engine;logfile=..\Log\BuildTemp.log /l:Kobush.Build.Logging.XmlLogger,loggers\Kobush.Build.dll;logfile=..\log\buildresult.xml

Then I get one log file called BuildResult.xml. It is not the XML output from the Kobush logger, but the standard output from the FileLogger.

Has someone got an example of multiple loggers specified on the command line that works correctly?

[993 byte] By [ksummerlin] at [2007-12-26]
# 1

Here is an example which works (yours however looks correct),

msbuild.exe /l:FileLogger,Microsoft.Build.Engine;logfile=c:\file1.xml /l:FileLogger,Microsoft.Build.Engine;logfile=c:\file2.xml;verbosity=detailed A.csproj

This will produce two files one from each logger, I added the verbosity switch so that the contents could be differentiated from each other.

Your syntax looks correct, could you however try and put quotes around the logfile paths as in logfile="..\Log\File.log". It looks like msbuild is using "logfile=..\Log\BuildTemp.log /l:Kobush.Build.Logging.XmlLogger,loggers\Kobush.Build.dll" as a parameter and not seeing them as two seperate loggers. If this was the case it would use the last logfile parameter as its log file path and you would only see one log file in the log directory with the file logger output.

ChrisMann-MSFT at 2007-9-4 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...

Visual Studio

Site Classified