elmah

Elmah not logging exceptions for http post requests in MVC app - if the request contains XML

余生长醉 提交于 2019-12-04 00:34:16
I've come across a weird problem in my MVC4 (RC) application. (running on .NET 4.0) I have just setup Elmah for logging exceptions / errors. I basically installed the Elmah.MVC and elmah.sqlserver NuGet packages. (versions 2.0.0 and 1.2 respectively) It seemed to work fine out of the box - I can go to the elmah page and view errors: http://myserver/elmah for example, if I create some 404 errors, they appear in this log. What is not working is this: I have a standard MVC controller with a [HttpPost] action. I've set it up so it will always throw an exception: public class TestController :

ELMAH on ASP.NET vNext?

此生再无相见时 提交于 2019-12-03 22:37:18
Is it possible to configure ELMAH with ASP.NET vNext? If so, how? I am lost as to where even start, given there's not even a web.config anymore. If anyone has or can figure it out, please share with us. Thank you ELMAH does not work with ASP.NET 5 because ELMAH (given its name) is based on ASP.NET 4.x's Modules and Handlers (the "MAH" of "ELMAH"). In ASP.NET 5 the replacement for modules and handlers is called middleware. There is a prototype in ASP.NET 5 called "ELM" (Error Logging Middleware) that has some features similar to ELMAH. You can check out a sample here: https://github.com/aspnet

Castle MonoRail & ELMAH

微笑、不失礼 提交于 2019-12-03 20:14:33
Is anyone using Castle MonoRail and ELMAH with success? We are using a number of Resuces to present users with friendly error messages, but if we do this the exceptions never get as far as ELMAH as the MonoRail rescue intercepts them. Ideally we want the user to see the rescue, but for the exception to be logged in ELMAH. Any ideas/pointers? Cheers, Jay. After looking at the links Macka posted, I wrote this simple monorail exception handler: public class ElmahExceptionHandler : AbstractExceptionHandler { public override void Process(IRailsEngineContext context) { ErrorSignal.FromCurrentContext

ASP.NET MVC - Elmah not working and returning 404 page for elmah.axd

▼魔方 西西 提交于 2019-12-03 18:09:51
问题 I'm trying to use elmah for my MVC application and I've followed the steps on the wiki: http://code.google.com/p/elmah/wiki/MVC , but even so when trying to access myapp/elmah.axd the page: 404 - File or directory not found. Anyone could help me please? OBS: My IIS Version is 7.5 If helps I'm posting the pertinent sections of my web.config: <sectionGroup name="elmah"> <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" /> <section name="errorLog"

Elmah add message to error logged through call to Raise(e)

家住魔仙堡 提交于 2019-12-03 16:53:53
问题 I'm a bit confused at how to add a message to an error logged programatically with ELMAH. eg: public ActionResult DoSomething(int id) { try { ... } catch (Exception e) { // I want to include the 'id' param value here, and maybe some // other stuff, but how? ErrorSignal.FromCurrentContext().Raise(e); } } It seems all Elmah can do is log the raw exception, how can I also log my own debug info? 回答1: You can throw a new Exception setting the original as the inner exception and ELMAH will log the

ASP.NET Invalid character in a Base-64 string

半腔热情 提交于 2019-12-03 16:23:22
I recently implemented ELMAH on my site and I have noticed that we frequently get the "Invalid character in a Base-64 string" error. I have never triggered it myself and none of our users have complained about it so I don't know what is going on. From the little I was able to find about it it seems like the viewstate might be getting too big or becoming corrupted or something. Does anybody know what causes this and how to prevent it? Here are what I believe are the pertinent lines in the YSOD. [FormatException: Invalid character in a Base-64 string.] [ViewStateException: Invalid viewstate.

Configuring ELMAH with SQL Server logging with encrypted connection string

◇◆丶佛笑我妖孽 提交于 2019-12-03 16:05:18
I'm attempting to configure ELMAH error logging in an ASP.NET 4 application using SQL Server 2008 R2. Is there any way I can tell ELMAH to call our in-house decryption function on the connection string we provide it? Do I need to modify the ELMAH source and rebuild? <configSections> <sectionGroup name="elmah"> <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" /> <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" /> <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah

Getting the Id of an error in Elmah after calling .Raise()

给你一囗甜甜゛ 提交于 2019-12-03 14:06:43
I'm working on an MVC3 application and I'm using Elmah to handle my error logging. What I want in my application is to carry the Elmah Id onto the custom error page as I will provide a link which allows a user to specifically report it in the event that it is a repeat error (in their opinion). Now, I've read similar questions on here and they suggest adding the following code (or similar) to the Global.asax.cs file: void ErrorLog_Logged(object sender, ErrorLoggedEventArgs args) { string sessionId = Session.SessionID; Session["ElmahId_" + sessionId] = args.Entry.Id; } This is what I'm using at

Securing Elmah RSS Feeds in ASP.NET website

天涯浪子 提交于 2019-12-03 12:36:43
问题 I followed the answer to this question Securing Elmah in ASP.NET website to restrict access to the elmah handler. However, it seems that adding an RSS feed to Outlook for the URL elmah.axd/rss or elmah.axd/digestrss bypasses the authentication. What's the point of securing the handler if someone can guess the RSS URL and subscribe to a feed of the error log? 回答1: I secure mine in the web.config with a role: <location path="elmah.axd"> <system.web> <authorization> <allow roles="SUPER_DUPER

How to get ELMAH to include session values?

久未见 提交于 2019-12-03 12:19:41
NOTE: I know the various reasons to avoid using the session, but this is a project I've inherited, so please skip that part of any replies :) Since it's a solved problem, I'm hoping someone can point to an ELMAH patch/branch/fork that includes logging session data rather than reinventing the wheel. One weird thing is an older post from Atif that says they're already logged: http://markmail.org/message/ncmdgwm5rmzewbwu commenter henningst mentioned adding in the session variables here: http://www.hanselman.com/blog/ELMAHErrorLoggingModulesAndHandlersForASPNETAndMVCToo.aspx Another approach (I'd