We are using the approach described here to log our webservice errors with Elmah. And this actually works, but sadly the username beeing logged is empty.
We did some debugging and found, that when logging the error in the ErrorHandler the HttpContext.Current.User has the correct User set.
I've just starting looking at a site in place at work. They're using Elmah to log errors.It seems to be logging fine, but in the web interface, when I tell Elmah to show me 100 errors per page, it only shows the most recent 15.Then when I click on "Download Log" I only get shown 15 errors in the CSV.Anyone know how I can configure it to keep all the errors?Or can someone point me to some docs on how to do this?
I'm using the suggestion from this question: How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?I used Aziz's second code sample.I ran the debugger to see what happens when an error occurs. The main function in the HandleErrorAttribute class is:
public override void OnException(ExceptionContext context) { base.OnException(context);
I'm debugging some unexpected behavior and while tracing in to the .NET framework I see a bunch of stuff like this:
if (Logging.On) { Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_n_certs_after_filtering, filteredCerts.Count)); ... }
But (as expected by default) the execution steps right over these. Is there some way to turn on the logging? Or is that just something that the framework developers can do while making special builds of the framework?
I want to show the admin pages only after logging in a form with username and password and also want to logout from the admin pages, if in the browser history select a admin page after logout it should not be shown
I spent a day trying to make Ent Lib Logging work and log anything into database or event log. I have a web application and console application with the same Ent Lib config but only the console application is capable to log into the Event Log. I tried everything with permissions but I don't know what exactly I am doing — which services should have what. It does not work!
I read articles like this[URL] and I want to try to give the ASPNET account those permissions. I am using Windows 7 and I cannot find ASPNET user account. So where is it?
This is the config file which is automatically generated from Ent Lib utility and it works only on App.config, not on web.config:
I think my subject line explains my problem in a nutshell.. I have a login page, I login like I should and everything works.I logout and when I type/paste the address to the page, in the address field, I still reach it just like if I was still logged in..The page I type in the address field is in a subfolder, only suppose to be able to be reached by logged in users and in this folder,ith it's own web.config-file:
I'm following this blog post about setting up ELMAH with MVC: [URL] I've only done part 1. Everything works correctly if I simply go to the Home controller, and then cause an error. I can view /elmah.axd as well, and my errors are logging in the database correctly.
However, I've added an area to my application named Admin. If I navigate to /Admin, I receive the following error:
System.MissingMethodException: No parameterless constructor defined for this object. public override IController CreateController(RequestContext requestContext, string controllerName) { var controller = base.CreateController(requestContext, controllerName); //Error here var c = controller as Controller;
I'm assuming this has something to do with my Area.
EDIT for jfar:
For instance, I have an Employees controller in my Admin area:
public class EmployeesController : Controller { private IEmployeesRepository employeesRepository; public EmployeesController(IEmployeesRepository employeesRepository) { this.employeesRepository = employeesRepository; } //... }
I have ELMAH setup on my production server and it has done a fantastic job of letting me know about any niggles - as well as any creative SQL injection!I've decided to introduce URl Rewriting and went for http://www.urlrewriting.net/ in the end. It was nice and easy to setup and it's doing exactly what I want with the customer-facing site.The problem is ELMAH. Because I've set the urlrewritingnet node in my config like so:
I'm interested in using ELMAH but need to configure it programmatically. We have existing infrastructure for determining connection strings and the like, and can't code them into Web.Config.How do I go about using ELMAH in this case?
I'd like to configure ELMAH for an ASP.NET MVC site entirely in code. This includes registering the module, setting the logging provider and settings, and filtering exceptions.The only part I've managed to do so far is filter exceptions. Has anyone else figured out how to do this? I'd really like to avoid cluttering up my config file with settings that won't ever change.
There used to be an article at ELMAHs docs site that contained this information, but it seems to have been removed. I think it's as simple as setting a configuration setting in the section, but I haven't a clue what it isCan anyone take a few seconds and drop the configuration setting here?
I am using Elmah in one of our production deployments and would like to secure the module to the local network only and not expose it to the public. I am aware of the remote logging option that can be turned off and also asp.net authorization, however I am interested to know if there is any support in Elmah's configuration to bind to a secondary NIC/network card which only faces the internal network ?
I'm using ELMAH to handle the exceptions in my ASP.Net MVC project. I would like to use it to log errors like database connection timeout, query connection timeout and others. Is this possible with ELMAH?
I spawn a thread on Application_Start and would like to log exceptions. There is not Context/HttpContext/HttpContext.Current, so how might i get it to log?ATM 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 dont think that will work well.-edit- i tried ErrorSignal.Get(new HttpApplication()).Raise(ex); and it doesnt seem to pick up that exception.
I was going to use ELMAH for our ultimate automatic error logging but recently realized that ASP.NET Health Monitoring does a same work (perhaps). Now I want to know (please) if they are alternatives of each other just like log4net and entlib?
I'm using Elmah with ASP.NET and wondering how I would add custom data, such as a session variable, to an unhandled exception email.I've tried several handlers in the Global.asax file but can't seem to find the right one.
This question builds on the following question:How to get Elmah working with ASP.NET and IIS 5.1 URL RoutingThe solution suggested there worked, as long as elmah.axd is off of the root of the site. What if you want to secure the site as blogged here:Securely Implement ELMAH For Plug And Play Error Logging?Moving elmah.axd to /admin/elmah.axd breaks the Fix IIS 5x Wildcard Mapping Module.My workaround was just to secure "elmah.axd" instead of "admin," like:
however every place i tried putting this tag in i get an Unrecognized configuration section elmah. error. I found this question [URL] however i tried that (solution at the bottom of the question) and still get the error. Where do i put this? i found the issue. I didnt set <sectionGroup name="elmah"> properly. I couldnt find it online then remembered the demo had sqlite logging and i checked the demo config for clues.