Thursday, May 11, 2017

ASP.NET core–Log errors to disk

Quick tip if your ASP.NET core application is crashing and you cannot figure out why.

Inside the web.config of the IIS hosting process, change the configuration. Set the sdtoutLogEnabled property to true and specify a location where to output the logs using the stdoutLogFile property.

<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>

Remark: I noticed that I had to create the logs folder first otherwise no files were written to this location…

No comments: