title: Catching C# errors at the class library level
body: <p>I am trying to work out an error logging solution for an enterprise-level class library.  Some of the requirements:</p>
  
  <ul>
  <li>It will be used by multiple end-point applications (hence why it should be handled in the classlibs)</li>
  <li>It should sink its data into a SQL Server database for easy storage.  This also goes into the third one:</li>
  <li>It should be able to support a custom web application reading its data.</li>
  </ul>
  
  <p>There's one more requirement, which is a 'very nice to have'.  That is, it's not critical, but if it's not feasibly possible I'd better have a darned good reason for it.</p>
  
  <ul>
  <li>It should not require specialized Logger objects in its end-point applications.  They should be able to simply throw exceptions and the logging software should handle things from there.  Having a specific USING command is kosher, though.</li>
  </ul>
  
  <p>The first three points are not that difficult, all things considered.  A quick logging class and some stored procedures, call it a day at noon, right?  The last point is something I don't know how to approach, though.  I've seen it done before in a friend's code, so I know it is possible, but said friend has unfortunately passed on and his code is lost to the ether.  Is there anyone out there who could point me in the correct direction of having a class library object somehow catch all errors coming up from an end-point application to process them?</p>