473,856 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Health Monitoring (asp.net c# web app)

32 New Member
Hi,

I am new to the built in health monitoring functionality that comes built into the .net framework. I have followed a v.good video tutorial and I cant seem to get the last part of my code to work correctly...

I have configured my app to display an error page (when necessary) and this will write errors to the event viewer along with my custom error messages - this works fine.

My problem is when I try to write these same errors to sql. Here is my code from web config:-

Expand|Select|Wrap|Line Numbers
  1. <healthMonitoring>
  2.       <eventMappings>
  3.         <add name="InputValidationEvent" 
  4.              type="WebEvents.InputValidationEvent, WebEvents"/>        
  5.       </eventMappings>
  6.       <rules>
  7.         <add name="InputValidationToSql"
  8.              eventName="InputValidationEvent"
  9.              provider="SqlWebEventProvider"
  10.              profile="Critical"/>
  11.       </rules>
  12.     </healthMonitoring>
Here is the code in my WebEvents assembly:-


Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Web.Management;
  5.  
  6. namespace WebEvents
  7. {
  8.     public class InputValidationEvent : WebFailureAuditEvent
  9.     {
  10.         public InputValidationEvent(object sender, string message) 
  11.             : base(message, sender, WebEventCodes.WebExtendedBase + 1)
  12.         {}
  13.  
  14.         public override void FormatCustomEventDetails(WebEventFormatter formatter)
  15.         {
  16.             base.FormatCustomEventDetails(formatter);
  17.             //formatter.AppendLine("This is where you can write custom message for the event logger!");
  18.             formatter.AppendLine(string.Format("Actual error exception raised by the PNWeb app : {0}",this.Message));
  19.         }
  20.  
  21.     }
  22.  
  23. }
What happens when an error occurs in my app:-

1) Errors are written to the event viewer - which is ok.
2) In App-Data (within my app) an ASPNETDB.MDF file appears, along with aspnetdb_log.LD F.

It doesn't write the error to the aspnet_webevent s_events table which exists in my DB?

So what I need to know is: Why does it write the error to the DB within the App_data folder & NOT to the aspnet_webevent _events table in my database?

Hope I've explained in enough detail - its driving me nuts!

Thanks
Janet
Jul 3 '07 #1
1 1929
kenobewan
4,871 Recognized Expert Specialist
Here is an article that may help:
Health Monitoring in ASP.NET 2.0: The Basics
Jul 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1179
by: athos | last post by:
Dear All, I am following the msdn guidelines (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000011.asp) trying the Health Monitoring module. Everything looks fine, webpage prompted out, button clicked, however, no record was logged in table "aspnet_WebEvent_Events"! Then I stepped in to debug, the line testEvent.Raise();
1
1341
by: russell.lane | last post by:
This is a health monitoring for web applications / web services question. I'm trying to set up health monitoring for web services and a web application. To start very simply, I want to turn on event logging for web requests. To do this I added the following markup to the <system.web> section of the web.config file in the service and application directories: <healthMonitoring enabled="true" heartbeatInterval="0"> <rules> <add...
3
1755
by: Glyn Simpson, MVP | last post by:
Hi I've got an ASP.NET 2.0 application, and I would like to catch the scenario of when I get a certain number of application errors, I want to restart the application (similar to 'touching' web.config). However, I don't have access to IIS, nor can I FTP in a new web.config file to force the application to restart.I can't see any way at the moment to do this through code, which would be good, as I can then restart it remotely (through...
0
2381
by: hui | last post by:
I am trying to use an SQL Server 2000 to log the events, and have found somehow the contents in the details column get truncated. Details as following: The query I am using to retrieve details: select datalength(details), details from dbo.aspnet_WebEvent_Events A sample output row (slightly realigned for easy reading): 1842 Event code: 4003 Event message: URL authorization succeeded for the
1
302
by: wwwmike | last post by:
Does anybody has a working example how I can intercept application restarts and send log information via emails or write them to my SQL Server 2000DB. Since I am on a shared server I do not have access to the log files myself but I want to monitor the health of my asp.net application for debugging. I checked out the webmanagement class, but honestly I am more a copy &
4
3488
by: Maddy | last post by:
Hi all, I am new to DB2 database.I just have the basic knowledge abt this database.I in a serious situation of handling 5 large databases.Can some one help me how to prepare the health check report for the databases. Also suggest me gud books for learning DB2. Thanks in advance,
1
1871
by: =?Utf-8?B?RGlnaXRhbERpYW1vbmQ=?= | last post by:
I'm fairly new to dotNet but I've set up a web site and SQL database, with Health monitoring on which works fine localy on my development machine. However when ever upload the web site to our web servers i get nothing logging. Any help would be great.Heres the relevant info from my web config. I know the connection string works as i use this else where in the site. <healthMonitoring enabled="true"> <eventMappings> <clear />
1
3012
by: brad.serbus | last post by:
I am trying to figure out a way to have health monitoring throw different Event IDs into the event log, and am having a hard time. None of the customization that I have looked through so far has been helpful, yet. As an example, here's a text copy of a typical unhandled exception from the event log: Event Type: Warning Event Source: ASP.NET 2.0.50727.0
2
1510
by: paeh | last post by:
Can any expert help me. I need to finish up my final project system next year. Can anyone give me some idea how to code my system. My system details is below : 1.Develop modules for a e-Intelligent Surveillance Systems and further enhance the public health monitoring and alert system 2.Develop a web based reporting program for communicable disease that accept electronic laboratory data from NIC health laboratory and other electronic...
0
9764
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,...
0
10699
jinu1996
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...
0
10390
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 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...
0
9535
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, 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...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7098
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();...
0
5762
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...
2
4176
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3203
bsmnconsultancy
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...

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.