I need help figuring out why the Application_Err or event on my global.asax
is not working. When I run my web application, I do get an error on the
screen but no log file/record is created. Here is the code I have for the
Application_Err or in my global.asax:
Sub Application_Err or(ByVal sender As Object, ByVal e As EventArgs)
Dim unhandledExcept ion As Exception =
Server.GetLastE rror().InnerExc eption
If Not EventLog.Source Exists("Mileage Efficiency Calculator") Then
EventLog.Create EventSource("Mi leage Efficiency Calculator",
"Mileage Efficiency Calculator Log")
End If
Dim el As EventLog = New EventLog
el.Source = "Mileage Efficiency Calculator"
el.WriteEntry(u nhandledExcepti on.Message)
Response.Write( "An exceptin occurred: Created an entry in the event
log ")
Server.ClearErr or()
End Sub
Is this a permission issue? Is there something I need to set up so my
application has the rights to create the new log file?
Thanks for your help. 3 1394
Hi Sal,
Yeah I think so. To check add your ASPNET/NETWORK SERVICE account
temporarily as an ADMIN user and see if it starts working. I wouldn't be
surprised if you don't need extended rights to create a new Eventlog source.
FWIW, I don't think it's a good idea to log stuff like that into the
EventLog. I would opt for an application specific log into an XML file in
the application directory or into a Database table. I would reserve the
EventLog for errors of more severity. Just my 2 cents <g>...
+++ Rick ---
--
Rick Strahl
West Wind Technologies http://www.west-wind.com/ http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Sal Young" <sa******@comca st.net> wrote in message
news:Cq******** ************@co mcast.com... I need help figuring out why the Application_Err or event on my global.asax is not working. When I run my web application, I do get an error on the screen but no log file/record is created. Here is the code I have for the Application_Err or in my global.asax:
Sub Application_Err or(ByVal sender As Object, ByVal e As EventArgs) Dim unhandledExcept ion As Exception = Server.GetLastE rror().InnerExc eption
If Not EventLog.Source Exists("Mileage Efficiency Calculator") Then EventLog.Create EventSource("Mi leage Efficiency Calculator", "Mileage Efficiency Calculator Log") End If
Dim el As EventLog = New EventLog el.Source = "Mileage Efficiency Calculator" el.WriteEntry(u nhandledExcepti on.Message) Response.Write( "An exceptin occurred: Created an entry in the
event log ") Server.ClearErr or() End Sub
Is this a permission issue? Is there something I need to set up so my application has the rights to create the new log file?
Thanks for your help.
Rick,
Thank you for your prompt reply. I did try what you suggested and added the
ASPNET account as a Administrator and that didn't solved the problem.
I'm really opposed to logging errors in a database because sometimes we get
database timeout errors; therefore, we can't access the database to log the
error.
"Sal Young" <sa******@comca st.net> wrote in message
news:Cq******** ************@co mcast.com... I need help figuring out why the Application_Err or event on my global.asax is not working. When I run my web application, I do get an error on the screen but no log file/record is created. Here is the code I have for the Application_Err or in my global.asax:
Sub Application_Err or(ByVal sender As Object, ByVal e As EventArgs) Dim unhandledExcept ion As Exception = Server.GetLastE rror().InnerExc eption
If Not EventLog.Source Exists("Mileage Efficiency Calculator") Then EventLog.Create EventSource("Mi leage Efficiency Calculator", "Mileage Efficiency Calculator Log") End If
Dim el As EventLog = New EventLog el.Source = "Mileage Efficiency Calculator" el.WriteEntry(u nhandledExcepti on.Message) Response.Write( "An exceptin occurred: Created an entry in the
event log ") Server.ClearErr or() End Sub
Is this a permission issue? Is there something I need to set up so my application has the rights to create the new log file?
Thanks for your help.
Is there some sort of error that occurs with the logging? If the log is not
being written to you should be able to trap the error that is occuring in a
Try/Catch blcok.
As to logging to file - I understand that issue, hence the other suggestion
to log to an XML or text file. Whatever works.
+++ Rick ---
--
Rick Strahl
West Wind Technologies http://www.west-wind.com/ http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Sal Young" <sa******@comca st.net> wrote in message
news:Pd******** ************@co mcast.com... Rick,
Thank you for your prompt reply. I did try what you suggested and added
the ASPNET account as a Administrator and that didn't solved the problem.
I'm really opposed to logging errors in a database because sometimes we
get database timeout errors; therefore, we can't access the database to log
the error.
"Sal Young" <sa******@comca st.net> wrote in message news:Cq******** ************@co mcast.com... I need help figuring out why the Application_Err or event on my
global.asax is not working. When I run my web application, I do get an error on the screen but no log file/record is created. Here is the code I have for
the Application_Err or in my global.asax:
Sub Application_Err or(ByVal sender As Object, ByVal e As EventArgs) Dim unhandledExcept ion As Exception = Server.GetLastE rror().InnerExc eption
If Not EventLog.Source Exists("Mileage Efficiency Calculator")
Then EventLog.Create EventSource("Mi leage Efficiency Calculator", "Mileage Efficiency Calculator Log") End If
Dim el As EventLog = New EventLog el.Source = "Mileage Efficiency Calculator" el.WriteEntry(u nhandledExcepti on.Message) Response.Write( "An exceptin occurred: Created an entry in the event log ") Server.ClearErr or() End Sub
Is this a permission issue? Is there something I need to set up so my application has the rights to create the new log file?
Thanks for your help.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: VinnieT |
last post by:
I have a load balanced system that consists of 3 production servers. There
are about 20 different applications that are used on these boxes. One of my
applications in particular is used more than the others. Since updating 2
applications, I have had problems on the event log of the servers, following
stopping of the aspnet_ws.exe process.
Something is causing the following error in the windows application event log:
The description for...
|
by: Umair Ahmed |
last post by:
Hi,
I m developing a web application on Win2k platform and
deploying the application on Win2k platform. I didnt get
any error on the development machine but when i deployed
to any machine on wch only .NET framework 1.o is
installed it gives the following error
Server Application Unavailable
The web application you are attempting to access on this
|
by: Steve Buster |
last post by:
All right, I have read every forum, newsgroup etc about
this issue and no one seems to know how to fix it. I am
getting a "Server Application Unavailable" exception
running my .NET 1.1 application. I use W2K SP4 and have
applied the hot Fix KB824146 and KB824105, both IE fixes.
I don't have VS installed because this is a Quality
Environment. I do have .NET SDK and .NET 1.1 Runtime
installed. I can't change my APSNET user to run as...
|
by: Robert Halford |
last post by:
On 4th May at 7.45 in the evening my asp.net web sites stopped working on my
development server.
The page that appears says:
Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser
to retry your request.
|
by: bruce |
last post by:
ASP.NET app running for about a year with no problem and suddenly this week
it's giving error message. The same as the one decribed by another user.
Even stranger is that we only have this problem from some web clients
(desktop browser, IE) , some other people do not have problems at all from
theirs desktop.
Also, some clients can access the web app but some can't! Some can use IE
but not Netscape, some can't with both,
but there are...
| |
by: whitehorse |
last post by:
When the warehousecontroller service is invoked, the following error message
is sent to the application log:
Event Type: Error
Event Source: TFS Warehouse
Event Category: None
Event ID: 3000
Date: 4/14/2006
Time: 2:41:08 PM
User: N/A
|
by: Ronald |
last post by:
I just started with dotnetnuke, and with a wrong login (wrong password
on a clean install i can crash the application pool from IIS.
(when i login with the right username/password information the site
works fine, i can do anything it is supposed to do)
I have the following setup:
-Windows 2003 x64 (fully patched, clean install)
-Dotnetframework 2.0.50727
-Dotnetnuke 4.3.1
|
by: David Lozzi |
last post by:
Howdy,
I found a nice little book called ASP.NET 2.0 Cookbook by Michael A Kittel
and Geoffrey LeBlond. Anyway, they have some instructions on how to setup
application level error handling. Most of my functions have try..catch to
email me about an error, then I want the application level to fire off to
send the user to a custom page AND log it in the app log. When an error
occurs on my page, i get a server error
Server Error in...
|
by: =?Utf-8?B?RGF2ZQ==?= |
last post by:
I have set up a virtual directory using IIS. Whenever, I load a web page of
type .htm, I have no problem. Whenever I run a .aspx page I get the statement
below. I am running on XP Pro, both Microsoft .Net 1.1 & 2.0 installed. How
do I remedy this error?
//Error below
Server Application Unavailable
The web application you are attempting to access on this web server is
|
by: Steve |
last post by:
Hello-
Your assistance with this issue is greatly appreciated.
Environment:
- Load-balanced IIS 6.0 servers (Win2003)
- web servers point (via UNC path) to a Microsoft File Cluster on
different machines.
- domain ASPNET account that handles the function/permissions of the
(traditionally) local machine ASP.NET account.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |