title: SQL Server error logging from a Stored Procedure
body: <p>Our application is Windows Service (native .EXE written in C++) that calls stored procedures in SQL Server. In most cases errors in stored procedures (in 90% of the cases these errors mean something was wrong in our business logic) are re-thrown as exception and caught by our service. They are then logged in Application Event Log on the computer where our service is running. </p>
  
  <p>However, I now have a need to log some of the errors on the SQL Server itself within a stored procedure.</p>
  
  <p>Following the paradigm we use for our service I think I can use xp_logevent to save error information in the event log.</p>
  
  <p>Is this a recommended approach to log SQL Server errors?</p>
  
  <p>FWIW I use SQL Server 2008</p>