You can write a user-defined messages to the SAP ASE error
log.
SAP ASE lets you manage:
New messages – include the with_log option in sp_addmessage when you add a new user-defined message to
sysusermessages. This parameter sets the
SAP ASE to log the message each time that the message appears.
Existing messages – include the with_log option in sp_altermessage to change an existing user-defined message.
This parameter alters the reporting status of that message:
TRUE – to enable logging.
FALSE – to disable logging.
See sp_addmessage and sp_altermessage in the
Reference Manual: Procedures.