Hi Atif
Thanks for clarifying it for me.
However my approach to using ErrorSignal is to programmatically log an
error to elmah in the global.asax as well as enable it to send out the
ErrorMail as well as return the id of the logged error. I do not wish
for elmah to log the error when it occurs but let it bubble up to the
global.asax then allow me to log it programmatically. By me using the
ErrorLogModule Logged event to return the loggedError object i have to
register the module in the httpmodules section of the web.config and
by then the error would have already been logged to elmah resulting in
logging the same error twice. I have removed the ErrorLog entry in the
httpmodules section of web.config to not allow elmah to log the error
when it occurs. As a result of removing the entry from the web.config
the errorlogmodule logged event method is not raised and i am now
unable to get the id of the logged error.
Is there any other way i can still programmatically log the error +
send out errormail and be able to retrieve the id of the logged error?
Hope this enough information so that you can see where im coming from.
Clayboy
On Jun 24, 2:12 pm, Atif Aziz <
aziza...@gmail.com> wrote:
> The problem is they way you're subscribing to the event, which works
> slightly differently with module events in
ASP.NET. You have to create a
> method named after the module name as found in the configuration followed by
> an underscore, followed by the event name and arguments. IOW, if you
> registered ELMAH's ErrorLogModule under the name "ErrorLog" then the event
> handler looks like this:
>
> void ErrorLog_Logged(object sender, ErrorLoggedEventArgs args)
> {
> ...
>
> }
>
> You don't need to do anything such as subscribing to the event.
ASP.NET will
> do this automagically on your behalf. See the following section of
> ASP.NETdocumentation for more on this:
>
> Using Modules with the Global.asax
> File<
http://msdn.microsoft.com/en-us/library/szzd570s%28VS.71%29.aspx>
>
> The relevant bit is:
>
> The code that you write to handle the events exposed by an HttpModule must
>
> > conform to the following naming pattern:
>
> > FriendlyModuleName_EventName(AppropriateEventArgumentSignature)
>
> - Atif
>