You can write a user-defined messages to the Adaptive Server error log.
Adaptive Server 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 Adaptive Server
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.