Click here to Skip to main content
15,886,832 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys, I want to do a log entry every time the update (PUT) method on an ASP.NET Web API is called, and I want that log to be saved on a DB table with the following columns:

- user (who changed something)
- dateTime (date and time the change was done)
- changes (what was before and what is now)

What is the best way to do this?
Posted
Comments
Sinisa Hajnal 6-Mar-15 6:23am    
Have the update query in stored procedure and after it passes, update the table with log data. Alternatively, have update in a method returning boolean and depending on the result, log success or fail. Note that you should take care of transaction if it is important to log each update.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900