By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,296 Members | 1,469 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,296 IT Pros & Developers. It's quick & easy.

Web.Config File - logging custom events in SQL Server.

P: n/a
I am trying to log events to SQL Server instead of the computers event
log, but, although I get no errors, I have no luck. The
webevents_events table is empty. I have a custom event that I am
raising (passwordchange), and can see it beign raised
successfully...just it seems to go nowhere. I have run aspnet_regsql
to setup the database to handle event recording. I am fairly sure I am
missing something in my web.config file. (I would like ALL
login/password related events to be logged in SQL server if possible).
Can anyone tell me what why my sight is not recording any activity in
SQL? (SOME non-custom events are being stored in my event logs...not
SQL Server)

Thanks,
Ryan

<--web.config file-->

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration
xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<add name="ConnOne" connectionString="Data Source=myserver;Integrated
Security=True;Initial Catalog=aspnetdb"/>
<add name="ConnTwo" connectionString="Data Source=myserver;Initial
Catalog=SRUTPL;Integrated Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
<appSettings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authorization>
<allow roles="Administrator"/>
</authorization>
<compilation debug="true" strict="false" explicit="true"/>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
<add namespace="CustomWebEvents"/>
</namespaces>
</pages>

<authentication mode="Forms"/>
<membership defaultProvider="MyMembershipProvider">
<providers>
<add name="MyMembershipProvider"
type="System.Web.Security.SQLMembershipProvider"
connectionStringName="ConnOne"/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider="MyRoleProvider">
<providers>
<add connectionStringName="ConnOne" name="MyRoleProvider"
type="System.Web.Security.SQLRoleProvider"/>
</providers>
</roleManager>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<healthMonitoring>
<bufferModes>
<add name="Extra Critical Notification"
maxBufferSize="10"
maxFlushSize="5"
urgentFlushThreshold="1"
regularFlushInterval="Infinite"
urgentFlushInterval="00:01:00"
maxBufferThreads="1"/>
</bufferModes>
<providers>
<add connectionStringName="eventConn" name="MyWebEventProvider"
maxEventDetailsLength="1073741823" buffer="true" bufferMode="Extra
Critical Notification"
type="System.Web.Management.SqlWebEventProvider"/>
</providers>
<rules>
<add name="Password Change Event" eventName="Password Change
Event" provider="MyWebEventProvider" minInterval="00:00:01"/>
</rules>
<eventMappings>
<add name="Password Change Event"
type="CustomWebEvents.CustomWebEvents.PasswordChan gedEvent,
CustomWebEvents"/>
</eventMappings>
</healthMonitoring>
</system.web>
</configuration>

Jan 27 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sorry for the accidental double double post...

Jan 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.