开发者

What are the available arguments for file logger when running MSBuild.exe?

I've read MSBuild Command-Line Reference at MSDN (the /logger parameter), but it is absolutely not clear enough.开发者_如何学编程 I need a list of available arguments for file logger.


Here are the parameters for MSBuild 3.5

  • Append : If an existing log file exists, it will be appended to instead of overwritten. You do not need to specify a value for this parameter; its existence will set it. In fact, if you specify a value, even false, it will be ignored! Default value is false.
  • Encoding : Used to specify the encoding that will be used to write the log file. This is interpreted by the System.Text.Encoding.GetEncoding(string) method. Default value is the default encoding for the system.
  • Logfile : Specifies the path to where the log file will be written. Default value is msbuild.log.
  • Verbosity : Used to specify the value for the verbosity of the logger. This uses the same values as mentioned previously. Default value is Normal for 2.0 and Detailed for 3.5.
  • PerformanceSummary : When passed as a parameter, the console logger will output messages that show the amount of time spent building tasks, targets, and projects. If you are trying to profile long running builds this may be very useful.
  • NoSummary : When passed, this suppresses the errors and warnings summary that is typically displayed at the end of the log.
  • NoItemAndPropertyList : Indicates to not display the values for properties and items that are typically shown at the start of the build log when using the diagnostic verbosity setting.
  • Summary : Shows errors and warnings summary at the end of the log.
  • ErrorsOnly : Shows only errors.
  • WarningsOnly : Shows only warnings.
  • ShowTimestamp : Displays a timestamp to every message.
  • ShowEventId : Displays the event ID for started, finished, and message events.
  • DisableMPLogging : Disables the multiprocessor logging style of output when running in non-multiprocessor mode.
  • EnableMPLogging : Enables the multiprocessor logging style even when running in non-multiprocessor mode. This logging style is on by default.

I took this from my book Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build.


The /logger parameter is useful if you want to specify a custom logger. In your case you just have to use the include file logger.

msbuild /fileLogger

This command logs the build output to a single file ("msbuild.log") in the current directory.

If you want to specify the directory use this command :

msbuild /fileLogger /fileLoggerParameters:LogFile=MyLog.log;Append;Verbosity=diagnostic;Encoding=UTF-8
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜