0

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.

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.