sp_errorlog

Dynamically changes the path of the error log.

Syntax

sp_errorlog “change log“, “new_path“ [,{“jslog true“ | “jslog false“}]
sp_errorlog “help”, “change log”

Parameters

Examples

Usage

sp_errorlog returns 0 if the switch to the new location is successful. A non-zero return value implies an error.

Note: To pick up the new location of the error log when the server is restarted, update the -e argument in the runserver file.

See Logging Error Messages and Events in the Configuration Guide for information on the runserver file.

Permissions

The permission checks for sp_errorlog differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be a user with manage server privilege.

Disabled

With granular permissions disabled, you must be a user with sa_role.

Auditing

Use the errorlog auditing option to audit changes to the error log administration.

When the errorlog audit option is enabled, any change to the error log generates an audit record with event=127. To view the event from sybsecurity, issue:
select * from sybsecurity..sysaudits01 where event=127
To enable the errorlog audit option enter:
sp_audit 'errorlog', 'all', 'all', 'on'