How to reduce the number of things SQL Server puts in the windows event viewer?

Posted on

Question :

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.

Answer :

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *