Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dotnet build with logger

If I want to specify a logger where I can set the name and location of the log file, I do the following:

dotnet build /l:FileLogger,Microsoft.Build.Engine;logfile=MyLog.log

This syntax has worjked for me in the past with msbuild, however it is not working with dotnet. What am I doing wrong?

enter image description here

like image 447
Noel Avatar asked Feb 01 '18 11:02

Noel


1 Answers

I took me some time to find this, but you can use fileloggerparameters (flp)

dotnet build /flp:v=diag

This will create log file msbuild.log. The Option [v]erbosity is set to [diag]nostic. But you can choose others verbosity levels.

Use the option logfile to specify the name of the log file.

dotnet build /flp:v=diag;logfile=MyLog.log

This also works with msbuild

msbuild /flp:v=diag;logfile=MyLog.log

Using Powershell the command for dotnet looks like

dotnet build /flp:v=diag /flp:logfile=MyLog.log
like image 131
Jehof Avatar answered Sep 23 '22 10:09

Jehof