elmah

Using a parameterless controller constructor with Ninject?

孤人 提交于 2019-12-13 18:13:33
问题 I'm using Ninject for dependency injection in my application. Here's an example of one of my controllers: public class DepartmentsController : Controller { private IDepartmentsRepository departmentsRepository; public DepartmentsController(IDepartmentsRepository departmentsRepository) { this.departmentsRepository = departmentsRepository; } ... } I'm also trying to follow this tutorial to use ELMAH in an MVC application. The idea is to use a custom controller factory to handle errors from every

Problem with Elmah in the GAC

时间秒杀一切 提交于 2019-12-13 17:42:51
问题 I am attempting to follow this article: http://www.codeproject.com/KB/aspnet/elmahGAC.aspx to get Elmah working from the GAC rather than needing to be setup for each application individually. Everything works locally but when the settings are set globally, Elmah stops logging. I read somewhere that if Elmah is running from the GAC then the settings should be in the "global" machine.config vs the "global" web.config but I've tried both. Right now, I'm at a point where if I add this: <system

MVC ELMAH v/s Application_Error

旧城冷巷雨未停 提交于 2019-12-13 15:56:16
问题 Background I had [HandleError] in place in my MVC web app for exception handling but later it couldn't handle some exceptions so I was suggested to move on to the alternative Application_Error (my SO Post) I also ended up using ELMAH which seems better. Well, ELMAH rocks! But I was unable to find how to show formatted exception with it (like I do with Application_Error) ELMAH v/s Application_Error ELMAH - Provides (almost) out of the box exception logging and other features like email. Its

Elmah logPath outside wwwroot

浪子不回头ぞ 提交于 2019-12-13 14:26:37
问题 We're trying to deploy our project but we can't get elmah to create the xml logs outsite the wwwroot. It's currently logging to inetpub{site}\wwwroot\App_Data because that's the only path that seemed to work. We would like to have it logging to our inetpub{site}\logs folder. Any ideas on getting this to work? We've already tried ..\ and ../ paths to the folder but they didn't seem to work. 回答1: Any ideas on getting this to work? You could provide an absolute path to the log file but you

Using ELMAH in medium trust

↘锁芯ラ 提交于 2019-12-13 05:16:32
问题 I'm building an ASP.net mvc app, and am having some problems getting ELMAH deployed using xml logging to a medium trust server, though it works fine on my local machine. It keeps getting a 404 error. The problem might be that the host doesn't allow relative filepaths, so the "~/App_Data" doesn't work for logging. I switched that to: logPath="\\Something\Something\ID\www.website.com\web\content\App_Data" in the web.config. The syntax might be completely off, but I've tried a few variations and

Send catched ajax exception back to server to perform logging?

前提是你 提交于 2019-12-13 04:21:14
问题 i have an MVC3 application and i'm using Elmah to store the errors in a mysql database and even send those errors by email. This is working perfectly, now i have this javascript code in my main layout: $(document).ajaxError(function (e, xhr, settings, exception) { //SEND BACK TO SERVER THE EXCEPTION }); Now, what i want to do is to get the catched exception (the ajax exception) and send back to server to a method that stores that exception with Elmah. Is that possible? If it isn't what choice

Configure Elmah email settings in code rather than config

微笑、不失礼 提交于 2019-12-13 03:33:46
问题 I'm setting up Elmah emails and I don't want to put my email account credentials in web.config. I'm deploying on Azure and therefore would like to look up the credentials from Azure app settings in code on app startup. Is there a way to configure Elmah emails declaratively in code rather than using the <errorMail> tag? 回答1: The best way to do this is by overriding the SendMail method of Elmah's ErrorMailModule , as suggested by Atif Aziz in this discussion on Google Groups. I've given more

Error filters in web.config are ignored when using ErrorLog_Filtering with ELMAH

浪尽此生 提交于 2019-12-13 00:12:01
问题 I have implemented an elmah filter that removes sensitive information from the exception being recording using a method similar to the one described here by overriding ErrorLog_Filtering in Global.asax. This works great, but it ignores the filters I have setup in web.config via the <errorFilter> elements. Is there some way I can apply my custom sanitization filter, but still make use of the filtering specified in web.config as well? 回答1: Answering my own question here -- it was as simple as

ELMAH: Can you set it up to email errors only remotely?

≡放荡痞女 提交于 2019-12-12 19:37:25
问题 While debugging my solution locally, I would like to not receive ELMAH error emails. I'd only like to receive them when the application is hosted on a remote machine. Is this possible? 回答1: I faced the same problem and rejected the idea of having different web.configs for local and remote as that just doesn't play nicely with source control (but see comments below). Instead, I added this to a Global.asax file in each site which uses Elmah: void ErrorMail_Mailing(object sender,

When I browse http://localhost:8004/elmah.axd, it generates 404 error

只谈情不闲聊 提交于 2019-12-12 17:01:01
问题 When I browse http://localhost:8004/elmah.axd it shows the errors that occurred in the application, but it also generates 404 error. How I will stop this 404 error? Details of 404 error is: System.Web.HttpException (0x80004005): File does not exist. at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response) at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String overrideVirtualPath) at System.Web