4

I want to minimize the output of certain warnings and messages in the SQL Server 2012 logs, such as when an spid is killed. I am unable to find information on suppressing/expanding which messages are actually sent to the error logs. Is this done through trace flags?

I am trying to reduce the number of warnings on our development database server and restrict it to legitimate errors. We have devs killing spids or flushing the query cache for performance tuning (playing with index tuning, forcing intentional table contention, creating deadlocks, etc), across multiple databases on the same server. Having a log file filled with these warnings is just an annoyance that I wanted to see if it were possible to suppress.

  • Why don't you just write your own wrapper procedure that filters them out instead? – Aaron Bertrand Feb 23 '17 at 1:20
3

Overall, suppression or inclusion of logging is generally accomplished via trace flags - you are correct.

This, however, does not mean that:

  1. There is a trace flag for each log item
  2. The trace flags are publically documented
  3. The trace flags don't differ through versions

such as when a spid is killed

There isn't a trace flag to turn this off, and I highly doubt that if there were one it would ever be documented or given out.

If the killed session messages annoy you, filter them out as Aaron has stated. You can create your own noise words list or known message list that you don't care about specifically for your dev environments.

Additionally, I'd look into giving them some SQL Azure databases to let them do development so that I didn't have to worry about this kind of stuff and could focus my time on actual production issues or new projects.

Disclaimer: I work for Microsoft.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.