Online Documentation for SQL Administrator for SQL Server

SQL Server Log


The SQL Server Log section of the Server Explorer allows you to analyze SQL Server server logs in a simple way, providing the ability to sort, filter and group log statements.

 

SQL Server Log

 

 

All logs have two common fields: Date and Message.

The grid of the SQL Server Log contains the following fields: Event Source, Log Type, Log Name.

The SQL Server Agent Log has the following fields: Error Level, Log Type, Log Name.

The Database Mail Log contains the following information: Event Type, Process, Mail Item ID, Account ID.

The Windows Log provides information about: Event Source, Category, Event Code, User, Event Type, Log Type, Log Name.

 

When you choose a row in the grid the fields below it are filled up with the following information (depending on the log type):

  • Message (for all logs) - displays any messages associated with the event;
  • Date (for all logs) - displays the date of the event;
  • Category (for Windows logs only) - the category of the event, which is sometimes used to further describe the related action;
  • Event code (for Windows logs only) - an identifier for the specific event;
  • Event type (for Database Mail and Windows logs) - the type of notice inserted in the log. Possible values are errors, warnings, informational messages, success messages, and additional internal messages;
  • Process (for Database Mail logs only) - the process id of the Database Mail external program. This typically changes each time the Database Mail external program starts;
  • Event Source (for SQL Server and Windows logs) - displays the source feature from which the event is created, such as the name of the service (MSSQLSERVER, for example);
  • User (for Windows logs only) - the user account that was logged on when the event occurred;
  • Error level (for SQL Server Agent log only) - indicates the type of problem encountered by SQL Server;
  • Mail item ID (for Database Mail only) - identifier of the mail item in the mail queue. NULL if the message is not related to a specific e-mail item;
  • Account ID (for Database Mail only) - the account ID of the account related to the event. NULL if the message is not related to a specific account.

 

Use the Print Print context menu item or the corresponding toolbar button to create and print the report.

 

Use the SelectLogs Select Logs toolbar button or the corresponding context menu item to launch the Select Server Logs dialog.

 

SQL Server Log - Select server logs

 

 

Use this dialog to set the logs to be displayed in the SQL Server Logs grid.

The following logs are available:

  • SQL Server Log

View this log to ensure that processes have completed successfully (for example, backup and restore operations, batch commands, or other scripts and processes). This can be helpful to detect any current or potential problem areas, including automatic recovery messages (particularly if an instance of SQL Server has been stopped and restarted), kernel messages, or other server-level error messages. SQL Server retains backups of the previous six logs and gives the most recent log backup the extension .1, the second most recent the extension .2, and so on.

 

  • SQL Server Agent Log

SQL Server Agent creates an error log that records warnings and errors by default. The following warnings and errors are displayed in the log:

  • Warning messages that provide information about potential problems, such as "Job <job_name> was deleted while it was running."
  • Error messages that usually require intervention by a system administrator, such as "Unable to start mail session."

SQL Server maintains up to nine SQL Server Agent error logs. Each archived log has an extension that indicates the relative age of the log. For example, an extension of .1 indicates the newest archived error log and an extension of .9 indicates the oldest archived error log.

 

  • Database Mail Log

Database Mail stores the log information in the msdb database. Information about Database Mail e-mail content, status of e-mails, and any messages received, such as errors are logged by Database Mail and can be used for troubleshooting and auditing purposes.

 

  • Windows Log

An important source of information for troubleshooting SQL Server errors, the Windows Event log contains four useful logs. The application log records events in SQL Server and SQL Server Agent and can be used by SQL Server Integration Services (SSIS) packages. The security log records authentication information, and the system log records service startup and shutdown information. The PowerShell Script log contains events logged by Windows PowerShell.