Reputation: 119
I need to implement Audit Trail in my application which is WinForm application. I need to log all the activity done by user on application and in System to see if he had changed any security settings or anything.
Is there any way to do this by AOP or using PostSharp
or any other such method which could be done with minimal changes in existing code as it is a very big application and implementing logging in every method is a time taking steps.
I am open to create a new application which could be for auditing purpose if it helps.
Please let me know any best practices I should follow to implement Auditing.
We are using .Net 4.5
and SQL Server 2005
.
Upvotes: 3
Views: 864
Reputation: 23044
Sounds like you want an audit of business-level operations attempted via your WinForms application.
Since, you asked about aspect-oriented approach - yes you can certainly use PostSharp's OnMethodBoundaryAspect
to plug in some logging/auditing behaviour with almost no change to existing code.
You will also get information about the caller and values of arguments passed which you can use to make your audits meaningful. Will update shortly with example. Further Reading
DISCLAIMER: I do not work for PostSharp. I just happened to try it out recently.
Upvotes: 1