elmah

ELMAH - Using custom error pages to collecting user feedback

北城以北 提交于 2019-11-28 21:52:07
I'm looking at using ELMAH for the first time but have a requirement that needs to be met that I'm not sure how to go about achieving... Basically, I am going to configure ELMAH to work under asp.net MVC and get it to log errors to the database when they occur. On top of this I be using customErrors to direct the user to a friendly message page when an error occurs. Fairly standard stuff... The requirement is that on this custom error page I have a form which enables to user to provide extra information if they wish. Now the problem arises due to the fact that at this point the error is

ELMAH - Exception Logging without having HttpContext

匆匆过客 提交于 2019-11-28 17:24:42
I tried this solution with Elmah.XmlFileErrorLog but I'm getting following exception System.ArgumentNullException was unhandled by user code Message="Value cannot be null.\r\nParameter name: context" Source="Elmah" ParamName="context" StackTrace: at Elmah.ErrorSignal.FromContext(HttpContext context) in c:\builds\ELMAH\src\Elmah\ErrorSignal.cs:line 67 at Elmah.ErrorSignal.FromCurrentContext() in c:\builds\ELMAH\src\Elmah\ErrorSignal.cs:line 61 at ElmahHttpErrorHandler.ProvideFault(Exception error, MessageVersion version, Message& fault) in c:\Myapplication\App_Code\Util\ElmahHttpErrorHandler.cs

Does elmah handle caught exceptions as well

烂漫一生 提交于 2019-11-28 15:57:51
Does ELMAH logged exceptions even when they do not bubble up to the application? I'd like to pop up a message when an exception occurs and still log the exception. Currently I've been putting everything in try catch blocks and spitting out messages, but this gets tedious. Michael La Voie ELMAH has been updated to support a new feature called Signaling . This allows you to handle exceptions how you want, while still logging them to ELMAH. try { int i = 5; int j = 0; i = i / j; //Throws exception } catch (Exception ex) { MyPersonalHandlingCode(ex); ErrorSignal.FromCurrentContext().Raise(ex); /

Can't access /elmah on production server with Elmah MVC?

一个人想着一个人 提交于 2019-11-28 04:49:47
I installed the elmah.mvc nuget package and kept the default configuration of that sans setting up sending an email and plugging it into a SQL database. On my local machine when I use the Visual Studio host, I can open my app and access /elmah fine to see a report of the errors. However, when I try and access /elmah on production, I get two errors, first I get a 403 access is denied server error. Then in my email (from elmah) I get: System.Web.HttpException: Server cannot set status after HTTP headers have been sent. Anyone know what is going on here and how to fix? Thanks. I tried the

How to secure Elmah.axd?

本秂侑毒 提交于 2019-11-28 04:38:37
We're using Elmah as our error logging system for an app that will be going into production soon. It's extremely useful, but if it goes into production like this anyone in the world access the error log because all they have to do is visit ourdomain.com/elmah.axd . This is obviously not ideal. I originally intended to restrict access to that page only to IP addresses within our company, but now our SysAdmins are saying that's not possible. So I'm asking here how can I prevent access to this resource? We running an ASP.NET MVC app on IIS 6. The typical scenario for securing elmah.axd is

Securing Elmah in ASP.NET website

南笙酒味 提交于 2019-11-28 02:39:29
I am having trouble trying to secure ELMAH. I have followed Phil Haacked's tutorial , with the only difference being the demo project is a web application and my project is a website. <add verb="POST,GET,HEAD" path="/admin/elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /> <location path="admin"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> With the leading "/" I receive the response that "The resource cannot be found.", if I remove the leading "/" everything works fine except authentication can be bypassed by appending a directory name in front

“Resource not found” error while accessing elmah.axd in ASP.NET MVC project

痴心易碎 提交于 2019-11-27 22:13:17
问题 My ASP.NET MVC application is within a folder called Stuff within IIS 6.0 webroot folder. So I access my pages as http://localhost/Stuff/Posts. I had EMLAH working while I was using the in-built webserver of Visual Studio. Now when I access http://localhost/Stuff/elmah.axd, I get resource not found error. Can anyone point my mistake here! Here is config file entry, <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/> //Handler <add name="ErrorMail" type="Elmah

Handle exceptions in web services with Elmah

孤街醉人 提交于 2019-11-27 21:02:56
Is there a way to globally handle exceptions in regular ASP.NET Web Service (asmx) using ELMAH like we do it in ASP.NET web site ? Tadas Šukys ASP.NET web services never fire Application_Error event and exceptions cannot be handled globally by ELMAH like in ASP.NET apps. But we can "manually" log exceptions using ELMAH: public int WebServiceMethod() { try { ... } catch (Exception ex) { Elmah.ErrorLog.GetDefault( HttpContext.Current).Log(new Elmah.Error(ex, HttpContext.Current)); } } You can use a SoapExtension to do this : using System; using System.Web.Services.Protocols; namespace

elmah: exceptions without HttpContext?

二次信任 提交于 2019-11-27 19:16:16
I spawn a thread on Application_Start and would like to log exceptions. There is no Context/HttpContext/HttpContext.Current , so how might I get it to log? At the moment, it does not catch any exception in my threads and if I write ErrorSignal.FromCurrentContext().Raise(ex); I get an error about context cannot be null. Maybe I can create a dummy HttpContext but somehow I don't think that will work well. -edit- I tried ErrorSignal.Get(new HttpApplication()).Raise(ex); and it doesn't seem to pick up that exception. Brendan Carey Make sure you set your application name in web.config <errorLog

How to configure ELMAH to work with Windows Azure? I get a 404 on Elmah.axd

主宰稳场 提交于 2019-11-27 17:50:23
I have an ASP.NET MVC web role running on Windows Azure and have setup ELMAH properly in the web.config. I also have my global.asax ignore *.axd routes. Locally, I am able to load /elmah.axd, however when I deploy to Azure, I get a 404 on that page. Has anyone gotten ELMAH working on Azure? Azure is based on Windows Server 2008 and IIS7. This means that you need to populate the system.webServer part of the web.config file. The sample file included with elmah's source code contains the details that you need to put in. <system.webServer> <validation validateIntegratedModeConfiguration="false"/>