We Both know in Sharepoint 2010 we have a feature called Site Collection Audit and Audit log. But this feature only on Sharepoint Enterprise, but on the Foundation we dont have that feature. With this application, we can enable audit feature on SP Foundation,
see all the log.
I took this code from MSDN Source code : http://msdn.microsoft.com/en-us/magazine/cc794261.aspx. After that i convert that code using Visual Studio 2010 and Deploy to Sharepoint 2010. You can use this code into Sharepoint Enterprise and Sharepoint Foundation
See this Screen Capture below :