---
title: Debug logging
description: Server-side scripts can write messages to AM debug logs by using the logger object.
component: pingam
version: 7.2
page_id: pingam:scripting-guide:scripting-api-global-logger
canonical_url: https://docs.pingidentity.com/pingam/7.3/scripting-guide/scripting-api-global-logger.html
llms_txt: https://docs.pingidentity.com/pingam/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
superseded_by: https://docs.pingidentity.com/pingam/7.3/scripting-guide/scripting-api-global-logger.html
---

# Debug logging

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

|   |                                                                                                                                                       |
| - | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | 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](../maintenance-guide/debug-logging.html) for the `amScript` service.

The following table lists the `logger` methods.

**Logger methods**

| Method                  | Parameters                         | Return Type | Description                                                                   |
| ----------------------- | ---------------------------------- | ----------- | ----------------------------------------------------------------------------- |
| `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.                  |
