I'm about to learn to handle logging in my c# asp.net mvc app and are going to store my log in a noSQL-db. How to handle the logging is done. The thing is I'm having a hard time to figure out possible things to log.

The app I'm building is a quite regular website, were a admin-user can login and edit content on the site using a wysiwyg-editor. Visiting users can send mail using a simple form.

The things I'm planning to log info about is functionalities like:

  • admin login/logout

  • visiting user send-mail status

  • admin changing content in the wysiwyg-editor(driven by js-function sending data to a c#-method through ajax. So basiclly log info when the c#-method gets hit)

To my question: what other possible things can I log in this type of application?

Any suggestions would be helpful


Sounds like you are unsure about why you are doing any logging in the first place? Well, here's 3 examples:

  • Auditing: Knowing who does what on your site, and when..?
  • Bug detection: having stack traces or similar information available can be crucial when tracking down a bug in production
  • Performance: For example; you want to know what the median time was for that huge picture to render

If you are still trying to learn I would argue you should try and log for one case of each of the above scenarios, just to get a feel for how it works, but remember writing log-statements is one thing; writing the right log statements is something completely different, and it is really only something you can learn from experience (I am yet to see a good article about what to log :) )

Good luck

Not the answer you're looking for? Browse other questions tagged or ask your own question.