Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
    
+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). –  Aaron Bertrand Jul 22 '13 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 Jul 22 '13 at 16:02

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.

share|improve this answer
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 Jul 22 '13 at 14:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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