xp_logevent

Description

(Windows only) Provides for logging a user-defined event in the Windows NT Event Log from within Adaptive Server.

Syntax

xp_logevent error_number, message[, type]

Parameters

error_number

is the user-assigned error number. It must be equal to or greater than 50000.

message

is the text of the message that is displayed in the description field of the event viewer. The maximum length of the message is 255 bytes. Enclose the message in quotes.

type

describes the urgency of the event. Values are informational, warning, and error. The default is informational. Enclose the value in quotes.

Examples

Example 1

An informational event, number 55555, will be logged in the Windows NT Event Log. The text of the description in the event detail window is “Email message deleted”:

xp_logevent 55555, 'Email message deleted.'

Example 2

An error event, number 66666, will be logged in the Windows NT Event Log. The text of the description in the event detail window is “DLL not found”:

xp_logevent 66666, 'DLL not found.', 'error'

Usage

Permissions

Only a System Administrator can execute xp_logevent.