简体   繁体   中英

MVC app not writing log files when deployed on IIS 7.5

When an exception occurs in my MVC app, the code creates a folder named Logs (if one doesn't exist already) under the ~ (app root) folder and under this folder, it creates a file (if one doesn't exist already) called MyApp.Exceptions.log. It then appends the exception information to this.

This is my home-grown logger. Works like a charm when I deploy locally.

On the remote server, though, no logs are generated. Not even the Logs folder is created.

I have given Read/Write/Modify permissions to IIS_USR (or whatever it is called) account for the whole ~ folder.

Please help.

Below are some details about my deployment environment.

Web Server: IIS 7.5

.NET Framework: v4

MVC version: 4

Windows Server: Windows Server 2008 R2 Standard

Sorry, I realized that I had to grant permissions to the user ASP.NET v4.0 , which was the name of the Application Pool / Identity under which my application was registered / running.

That solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM