Reputation: 8540
I have a site, that uses StackExchange.Exceptional to log exceptions. Problem is, that it does not log all exceptions, like on my development machine.
If it would not log any exceptions, I would think that some configuration/permissions are not working on Azure Websites, may be module is not loaded/working, but for example if I misstype controller action, I get an exception logged:
A public action method 'Logi' was not found on controller 'Acme.Controllers.AccountController'.
I've tried running site using release configuration localy, it works without problem.
As I understand, StackExchange.Exceptional is http module, that is logging unhandled exceptions using this code:
protected virtual void OnError(object sender, EventArgs args)
{
var app = (HttpApplication)sender;
var ex = app.Server.GetLastError();
LogException(ex, app.Context);
}
May be in some cases on Windows Azure it does not receive OnError event, any ideas what to check, where to search for a clue?
Upvotes: 3
Views: 345
Reputation: 8540
I've managed to replicate the same behaviour on local machine with added this setting:
<customErrors mode="On">
As long as RemoteOnly
mode is default, I wasn't seeing problem on local development machine. Not sure why, but when customErrors
are enabled, some exceptions were not logged through http handler.
Upvotes: 1