简体   繁体   English

部署在IIS 7.5上的MVC应用程序不写入日志文件

[英]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. 当我的MVC应用程序发生异常时,代码在〜(应用程序根目录)文件夹下创建一个名为Logs的文件夹(如果尚不存在),并且在此文件夹下创建一个文件(如果尚不存在) )称为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. 我已为整个〜文件夹的IIS_USR(或任何称为)的帐户授予了读取/写入/修改权限。

Please help. 请帮忙。

Below are some details about my deployment environment. 以下是有关我的部署环境的一些详细信息。

Web Server: IIS 7.5 Web服务器: IIS 7.5

.NET Framework: v4 .NET Framework: v4

MVC version: 4 MVC版本: 4

Windows Server: Windows Server 2008 R2 Standard Windows Server: Windows Server 2008 R2标准版

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. 抱歉,我意识到必须向用户ASP.NET v4.0授予权限,这是在其上注册/运行应用程序的应用程序池 / 标识的名称。

That solved the problem. 那解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当部署到IIS 7.5上的子目录时,C#Web API 2应用程序在GET方法上生成404 - C# Web API 2 app generates 404 on GET method when deployed to sub directory on IIS 7.5 IIS 7.5 MVC 5部署的网站将无法连接到SQL Server - IIS 7.5 MVC 5 deployed website will not connect to SQL Server ASP.NET MVC 3.0 部署的代码在 IIS 7.5 的 IE8 中不起作用 - ASP.NET MVC 3.0 deployed code not working in IE8 in IIS 7.5 如何在IIS 7.5上获取角度全栈的angular.js文件 - How get the angular.js files on IIS 7.5 for angular full-stack deployed 在 ASP.net Mvc 应用程序中的 IIS 中部署应用程序时,水晶报表无法加载 - Crystal report fails to load when application is deployed in IIS in ASP.net Mvc app ASP.NET / IIS7.5编写日志文件不起作用(权限,UAC,配置,???) - ASP.NET/IIS7.5 Writing Log File Not Working (Permissions, UAC, Config., ???) jQuery datatable tabletool另存为Excel,CSV,PDF,在IIS7.5上部署时无法复制和打印 - Jquery datatable tabletool Save as Excel, CSV, PDF, copy and print not working when deployed on IIS7.5 尝试访问部署到IIS 7.5的Web API 2服务时出现404错误 - 404 Error when trying to access Web API 2 Service deployed to IIS 7.5 ASMX服务在开发服务器上运行,在部署到IIS 7.5时返回404 - ASMX service works on development server, returns 404 when deployed to IIS 7.5 在IIS 7.5中部署应用程序的问题 - Issue with Deploying an app in IIS 7.5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM