473,396 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Writing error to Application Log in ASP.Net 2.0

Howdy,

I'm working on some error handling for my application. Currently on WinXP
Pro SP2. Basically this is what I'm doing:

Try...Catch at the method level, Catch sends email with error

Page_error has code:
Throw Server.GetLastError

Application_error in global.asax has code:

Dim LogSource As String = ConfigurationManager.AppSettings("WebsiteName")

Dim LastExc As Exception = Server.GetLastError

Dim message As String = LastExc.Message & "<br>" & LastExc.ToString

EventLog.WriteEntry(LogSource, message, EventLogEntryType.Error)
web.config has
<customErrors mode="On" defaultRedirect="~/error.aspx"/>
When an error occurs the browser sends to error.aspx fine, but nothing is
written to the Application log. Here's what I get there
The following exception was thrown by the web event provider
'EventLogProvider' in the application '/patterns' (in an application
lifetime a maximum of one exception will be logged per provider instance):

System.Web.HttpException: The EventLogWebEventProvider provider failed to
log an event with the error code 0x800705DE.

at System.Web.Management.EventLogWebEventProvider.Pro cessEvent(WebBaseEvent
eventRaised)

at System.Web.Management.WebBaseEvent.RaiseInternal(W ebBaseEvent
eventRaised, ArrayList firingRuleInfos, Int32 index0, Int32 index1)

For more information, see Help and Support Center at

I've added the LogSource as specified in the code above to
HKLM\System\CurrentControlSet\Services\Eventlog\Ap plication as a Key. From
what I've read, I should do a Server.Transfer in the Application_Error
function, not use the customError defaultRedirect in web.config. If I set it
up like this, nothing happens, I get the generic.net error page.

So to sum up, I'm trying to get error handling at the application level
working so that the Application Log will receive the error and I would like
the error to be sent to the error.aspx page if possible to display in the
event they call customer service. I will be notified of the error first when
the Catch sends the email.

Thanks!
--
David Lozzi
dlozzi@(remove)delphi-ts.com
www.delphi-ts.com

Aug 3 '06 #1
0 3587

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul P | last post by:
I am having a problem writing errors to the application log on a Windows 2003 server running IIS 6 The error message is "InvalidOperationException: Cannot open log for source {0}." I have created...
2
by: Scott Vercuski | last post by:
Everyone, I'm having trouble writing an event to the event log. Here is the chunk of code I currently have. ----------------------------------------------------------------------- Private...
9
by: Kelly Vernon | last post by:
I have a standard ASP page that appends to an xml page. Currently if there is more than one person attempting to append to the same XML file at a time. One user will have the ability to append,...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
4
by: HNguyen | last post by:
Hi, I have a Web application in ASP.NET. My Application allows the users upload files into the server after checking their user names and passwords. For each transaction, the Web program will...
3
by: Jaime Stuardo | last post by:
Hi all... I have an ASP.NET 2.0 application. This application uses 2 components, named Informe.dll and Seguridad.dll, whose source codes are under the same solution as the ASP.NET application....
3
by: Jennifer | last post by:
On an ASP page I've got some code that is supposed to "export" data in a grid to an Excel file. What I'm doing is writing all the data to a text file, separating the fields by commas. Then I'll...
6
by: JeffDotNet | last post by:
Writing to a registered source in the Application event log I have an asp.net framework 2.0 app that I created on a winxp machine and now I am deploying it to IIS6 on a win server2003 machine. ...
89
by: Skybuck Flying | last post by:
Hello, This morning I had an idea how to write Scalable Software in general. Unfortunately with Delphi 2007 it can't be done because it does not support operating overloading for classes, or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.