473,414 Members | 1,674 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,414 software developers and data experts.

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

32
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.LDF.

It doesn't write the error to the aspnet_webevents_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 1904
kenobewan
4,871 Expert 4TB
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
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...
1
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...
3
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'...
0
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:...
1
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...
4
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...
1
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...
1
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...
2
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...
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
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,...
0
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...

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.