I'm looking for a better logging approach for a large MVC project. I tried to look around towards other's suggestions (like Log4Net, Nlog, ELMAH, EntityFramework's Self tracking & few others), but could not find reasonable answer. By term logging
i don't simply mean logging few requests or exceptions etc. But log for every little change in properties. That's the reason I'm looking for some perfect (generic) approach, which can be used for several applications. I need to roughly log as:
public class someModelPerson
{
public string Name { get; set; }
public string Age { get; set; }
}
If through some action, the current object of someModelPerson
is updated, I need to log at the end of the method as:
Property Name changed from 'John' to 'Don' by user 'xyz' on 12/12/12
I worked with EntityFramework selftracking
and implemented something similar and generic (using templates etc) but it's no more recommended by Microsoft.
I'm okay if the solution requires a little customization accordingly.
plus do suggest the better DB schema for storing log of single model modifications. (like update_person
method may change name, age, height of a person. How should it be logged at DB level? single entry? separate table for changeset?)