Debug Logging

Server-side scripts can write messages to AM debug logs by using the logger object.

Note

The scripting API does not use the logback logger that is used by the rest of AM. Instead, it uses an instance of the custom AM Debug logger class.

AM does not log debug messages from scripts by default. To configure AM to log script messages, set the debug log level for the amScript service. For details, see Debug Logging.

The following table lists the logger methods.

Logger Methods
MethodParametersReturn TypeDescription

logger.error

Error Message (type: String)

Void

Write Error Message to AM debug logs if ERROR level logging is enabled.

logger.errorEnabled

Void

Boolean

Return true when ERROR level debug messages are enabled.

logger.message

Message (type: String)

Void

Write Message to AM debug logs if MESSAGE level logging is enabled.

logger.messageEnabled

Void

Boolean

Return true when MESSAGE level debug messages are enabled.

logger.warning

Warning Message (type: String)

Void

Write Warning Message to AM debug logs if WARNING level logging is enabled.

logger.warningEnabled

Void

Boolean

Return true when WARNING level debug messages are enabled.


Read a different version of :