Registering user actions on an ASP.NET site?

What I want is a system that uses user-invoked logging methods and return their values, if any. For example, a user logs in and he / she is surfing my web application. then naturally he / she clicks on something and so he / she fires some event method and then my registration system has to register this method name and timestamp combined with the username or user id in the database.

So how can I do this in asp.net.

0


source to share


2 answers


Well, the easiest way is to just add all registration instructions to your code using a registration framework like Log4Net . If you want a more automatic way to do this, you can look into PostSharp so you can just decorate the appropriate methods with an attribute - but this is definitely more complicated and probably worth it to have a lot of events to register.



+3


source


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



+1


source







All Articles