8

As part of our automated unit tests, a lot of databases get created, set up, then dropped. The problem is that every time this happens, we get a bunch of records from SQL Server in the Windows Event Viewer. The messages are mostly things like: "Starting Up", "Setting database option", and "index restored".

Is there any way to modify the SQL Server config so that it doesn't log these trivial "Information"-level events to the event log. They are filling up the log so that it becomes very difficult to find useful information.

2 Answers 2

9

Note: This will not limit what gets logged. It justs stops logging in Windows Event log.

There are some stuff that you can prevent like - successful completion of log backups using Trace Flag 3226

Have a look at -n startup parameter.

From Database Engine Service Startup Options :

Does not use the Windows application log to record SQL Server events. If you start an instance of SQL Server with -n, we recommend that you also use the -e startup option. Otherwise, SQL Server events are not logged.

2
  • +1 but if you're going to use this make sure you don't have other monitoring in place that relies on the event log (e.g. SCOM). Commented Jul 22, 2013 at 15:38
  • @AaronBertrand Agreed that SCOM heavily relies on Windows event logs and disabling to log in Windows event logs is something I would not recommend on a PROD server.
    – Kin Shah
    Commented Jul 22, 2013 at 16:02
0

If you are saying for the system event viewer,I dont think so that way you can do, as it requires to be logg in to it inorder to analyze or troubleshotting purpose so.

Incase if you are fine to purge the events then you can set for how much required in the Maximum log size or other options exists too(you can see in the eventpmanger->select anyone like application log ->right click properties->there you see the option as you need in which way.

1
  • 4
    I don't know how this will help the OP as he explicitly says how to limit what gets logged by sql server in windows event logs. What you are telling is how to purge event logs.
    – Kin Shah
    Commented Jul 22, 2013 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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