Writing messages to the server log

To record errors generated by PowerBuilder objects running in an application server to %PB_SERVER_HOME%\logs\pb-server.log, create an instance of the ErrorLogging service context object and invoke its log method. For example:

ErrorLogging errlog
getContextService("ErrorLogging", errlog)
errlog.log("Write this string to log")

You can use the ErrorLogging service to provide detailed information about the context of a system or runtime error on the server. This information is useful to system administrators and developers in resolving problems.

While you are developing components, you can use the ErrorLogging service to trace the execution of your component. For example, you can write a message to the log when you enter and exit functions. The message can identify the name of the component, the name of the function, and whether it is entering or exiting the function.