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

后端 未结 5 914
野趣味
野趣味 2020-12-09 15:35

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:



        
5条回答
  •  眼角桃花
    2020-12-09 16:32

    I created the logs folder but still, nothing was logged. I found out that you can use an existing folder under home/logfiles and make it work without creating a folder. This solution worked for me as is:

    1) Open the web.config file that is created in the root folder of the published application.

    2) Set stdoutlogEnabled to true and stdoutLogFile to \?\%home%\LogFiles\stdout like this:

    
    

    Then you can either go to that path and download the files or use the Azure Portal (if it's hosted in Azure). If you are using the Azure Portal:

    1) Go to the app service.

    2) Go to Advanced Tools which takes you to https://{your app service}.scm.azurewebsites.net/

    3) Click on Debug Console menu --> CMD

    4) Click on LogFiles

    5) You'll see a file called stdout_*.log and you can click on the pencil to view it. You can also download the file if you want.

提交回复
热议问题