views:

389

answers:

2

Hey,

What I want is system which is logging methods called by users and their returning values if they have. For example a user logs in and he/she is surfing on my web app. then naturally he/she clicks on somethings and so he/she fires up some event method whatever then my log system must log this method name and time stamp combined with user login name or id into database.

So how can I do that in asp.net.

+3  A: 

Well, the simplest way is just to add all the logging statements to your code, using a logging framework such as Log4Net. If you want a more automatic way of doing this, you might want to look into PostSharp so that you could just decorate the appropriate methods with an attribute - but that's certainly more complex, and probably only worth it if you have a lot of events to log.

Jon Skeet
+1  A: 

you can attach your write logic class to events triggered from parts of code. using events driven architecture is a good pattern

Moran