1

When publishing an ASP.Net core app, the generated web.config file has the following entry for logging

<aspNetCore processPath="dotnet" arguments="..." stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">

I would like to change the value of "stdoutLogFile". Looking at the question Publish to IIS, setting Environment Variable, I can similarly change the log file settings in IIS. However, the changes are reverted next time I publish. How can I specify the log file location and prevent it from changing back to the default every time I publish?

Elfalem
  • 347
  • 3
  • 17

1 Answers1

3

There is a web.config file in the application that is used to configure the ASP.NET Core Module. You can set the stdoutLogEnabled and stdoutLogFile attributes in that file. Those settings will be used when running the app in IIS and will persist since it's part of the publish process. Microsoft doc

Elfalem
  • 347
  • 3
  • 17