locked
Logging to event log RRS feed

  • Question

  • hi,

    Looks like the xp_logevent or the Raiseerror will log to default application event log and doesn't support to log to custom event log. Also,we can't specify event ID and SQL uses a constant ID for logging all system or custom messages using above procedures.

    Is there a way we can implement logging to a custom event log and also with specif event id in SQL Server so that I can configure event log monitor using SCOM for some specific events?

     


    Trinity
    Wednesday, September 1, 2010 7:36 PM

Answers

  • you are right, it does nto allow customizing eventid but you can categories eventid based on type of message you write. If I remember correctly then Error and Warning goes as event id 17063, Informatiion goes as event id 17061. So you can configure SCOM for these event id and filter on Error Description for Error Number that can be custom number based on what value pass for Error Number parameter in xp_eventlog

     


    Thanks, Mohan Kumar www.sqlvillage.com -- Please mark the post as answered if it answers your question.
    Wednesday, September 1, 2010 8:48 PM
  • You can still decide to write a customer DLL on write the event log entries from here.

    -Jens


    Jens K. Suessmeyer http://blogs.msdn.com/Jenss
    Wednesday, September 1, 2010 9:58 PM

All replies

  • you are right, it does nto allow customizing eventid but you can categories eventid based on type of message you write. If I remember correctly then Error and Warning goes as event id 17063, Informatiion goes as event id 17061. So you can configure SCOM for these event id and filter on Error Description for Error Number that can be custom number based on what value pass for Error Number parameter in xp_eventlog

     


    Thanks, Mohan Kumar www.sqlvillage.com -- Please mark the post as answered if it answers your question.
    Wednesday, September 1, 2010 8:48 PM
  • You can still decide to write a customer DLL on write the event log entries from here.

    -Jens


    Jens K. Suessmeyer http://blogs.msdn.com/Jenss
    Wednesday, September 1, 2010 9:58 PM
  • Thanks for the response. I'm not much familiar with SCOM, can we filter on error description for error number(or any other string) ? We have lot of error and warning events and we want to implement alerting only for error events, filtering will it incurr considerable overhead on the system? 

    We are already logging all our errors to SQL table logs (for retaining historic data for trending) and the other approach we are considering to implement SCOM alerting is configure SCOM monitor to read table and look for any specific error events using sql sp interface. which one do you think is the best approach?

     


    Trinity
    Friday, September 3, 2010 12:06 AM