Logging Username With Elmah For WCF Webservices?

Oct 12, 2010

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.

We also tried:

HttpContext context = HttpContext.Current;
ErrorLog.GetDefault(context).Log(new Error(pError, context));

and

ErrorLog.GetDefault(null).Log(new Error(pError));

Without success.

how we can make Elmah log the username?

On a sidenote, when logging the error directly within the Webservice, the username is logged as expected. But taking this approach is not very DRY.

View 1 Replies


Similar Messages:

C# - Elmah Is Only Logging 15 Errors?

Jun 10, 2010

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?

View 2 Replies

C# - ELMAH Not Logging Errors In MVC 2 App?

Feb 3, 2011

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);

[code]...

View 3 Replies

Logging From Framework Internals (Logging.On) - How To Turn On Logging

Jul 6, 2010

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?

View 1 Replies

Security :: Form Aunthetication / Show Admin Pages Only After Logging In A Form With Username And Password?

Jan 27, 2010

Me with C# asp.net

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

how can I do it.

View 1 Replies

Performance - What Logging Listener Should Be Used In Production ( Logging Application Block)

Sep 10, 2010

I'm using MS Enterprise Logging Application Block in an ASP.NET website.

For production launch, I will set up a log listener in one of these locations:

Sql Server database
Windows event log
Text files

Which has the least impact on performance?

NB - I can't switch to Log4Net or ELMAH at this point, so don't suggest that in your response.

View 3 Replies

Enterprise Library Logging Not Logging To Event Log?

Jun 3, 2010

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:

[code]....

View 4 Replies

Security :: Logging In, Logging Out And Still Logged In?

Jan 12, 2011

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:

<?xml version="1.0"?>
<configuration>
<system.web>

[code]...

View 9 Replies

Security :: Update Username Of Current Logged Username?

Mar 12, 2010

How to update username of current logged username?

View 10 Replies

C# - Using ELMAH With Areas In MVC 2?

Jan 24, 2011

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;
}
//...
}

View 1 Replies

How To Setup Elmah

May 21, 2010

I am trying to setup elmah for asp.net 1.1 application.i have following entry in my web.config

<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>

[code]...

View 2 Replies

C# - Using ELMAH And URLRewritingNet Together?

Feb 24, 2010

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:

<urlrewritingnet
rewriteOnlyVirtualUrls="true"
contextItemsPrefix="QueryString"

[code]...

View 2 Replies

How To Configure ELMAH Programmatically

May 7, 2010

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?

View 1 Replies

Is It Possible To Configure ELMAH Entirely In Code

Jun 22, 2010

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.

View 2 Replies

How To Get ELMAH To Throw Its Own Exceptions

Aug 3, 2010

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?

View 1 Replies

Elmah And Network Cards?

Dec 1, 2010

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 ?

View 1 Replies

Use ELMAH To Log Database Errors?

Mar 5, 2010

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?

View 2 Replies

C# - Determine Whether Or Not ELMAH Is Enabled?

Jan 31, 2010

How can I determine programmatically whether or not ELMAH is enabled?

View 2 Replies

C# - Elmah: Exceptions Without HttpContext?

Jan 21, 2010

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.

View 2 Replies

ELMAH On IIS 7.5 Producing HTTP 404 Error?

Apr 14, 2010

So, have an ASP 3.5 site built using ELMAH.

It runs fine under IIS 5.1, I can see all the error pages, etc.

Set up the site on another machine running IIS 7.5.

Now when I go to my /admin/elmah.axd page, i see a 404 error from IIS 7.5.

View 1 Replies

Are Health Monitoring And ELMAH Alternatives Of Each Other

Feb 21, 2010

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?

View 3 Replies

Custom Elmah YSOD Data?

Mar 2, 2010

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.

View 2 Replies

Handle Exceptions In Web Services With Elmah

Feb 1, 2010

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 ?

View 2 Replies

.net - How To Secure Elmah Working With IIS 5.1 URL Routing

Feb 23, 2010

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:

<location path="elmah.axd">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

Although this works, I feel that there's got to be a more elegant solution.

View 3 Replies

Part Of Web.config To Insert Elmah Tag?

Jan 21, 2010

I want to write this

<elmah>
<errorlog type="Elmah.XmlFilerErrorLog, Elmah" logPath="~/App_Data" />
</elmah>

or

<elmah>
<errorLog type="Elmah.SQLiteErrorLog, Elmah" logPath="~/App_Data" />
</elmah>

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.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved