Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do logs go when running ASP.NET Core on IIS 7.5?

I'm posting this and answering it, because this left me stumped for a very long time. I have the following line in my web.config:

<aspNetCore processPath="dotnet" arguments=".\XXX.Server.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" /> 

So apparently, this should be logging to logs\stdout, but when I look, there's nothing there. I went on a wild goose chase, searching the whole disk for anything named 'log' (that returned too much) or 'stdout' (that returned nothing), and still couldn't figure it out.

like image 891
Andrew Williamson Avatar asked Nov 10 '16 20:11

Andrew Williamson


People also ask

Where do .NET Core logs go?

You have literally declared that logs will go to four potential destinations: App Insights, the console, the debug output, and the event viewer.

Where does IIS store its logs?

IIS log files are stored by default in the %SystemDrive%\inetpub\logs\LogFiles folder of your IIS server. The folder is configured in the Directory property on the Logging page for either the server or an individual site.

Where are ASP Net logs?

Though there is some detailed info in Event Viewer for some types of events. In IIS6 (and prior), this is located in %SystemRoot%\system32\logfiles , and in IIS7, this is located in %SystemDrive%\inetpub\logs\LogFiles . In both cases, it will be placed in a subfolder called W3SVC{Id} .

Where is the ASP.NET Core module stdout log?

\%home%\LogFiles\stdout .


2 Answers

You could probably check the Event Viewer on your machine -> Application to see if there are any errors logged, which could explain why your log files aren't being generated.

However, the most probable reason is that IIS doesn't have a permission to write to that log folder.

  1. Right click on the folder -> Security
  2. Ensure that IIS_IUSRS user has the following permissions: read and execute, list, write (potentially write is missing by default)
like image 57
Vlatko Vlahek Avatar answered Sep 19 '22 21:09

Vlatko Vlahek


You must make sure the log folder exists! IIS won't make it for you. Such a simple solution to this infuriating problem.

like image 24
Andrew Williamson Avatar answered Sep 18 '22 21:09

Andrew Williamson