views:

38

answers:

1

Hello, I need to slightly tweak the functionality of the ASP.NET Membership provider to add custom logging functionality. Instead of creating a wrapper class around the methods I wish to modify, I was toying with the idea or creating a custom Membership Provider and override a few of the methods.

All the examples I could find would show how to create it from scratch. I don't want to overwrite everything... just override a few methods. Can somebody point me in the right direction?

Thanks!

EDIT: DOH! I can simply inherit from SqlMembershipProvider and override the methods. However, how can I get at the connection string?

A: 

What is it that you are trying to log?

If you simply want to monitor success and failure of authentication, ASP.NET Health Monitoring is already in the box. Events are logged to the WebEvent tables.

If you have other motives, well then..... ;-)


to answer your question about the connection string, override Initialize and capture the value from the config argument before calling base.Initialize

Sky Sanders
Here are my requirements (not complete list): 1) Successful login, 2) Failed login, 3) Password change, 4) Password reset. Not all of these will be covered by the overridden Membership class.
Mike C.
@mike - see update
Sky Sanders