---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, PMD Scripting, Scripts]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: PMD Scripting Logging
layout: subsection
---

<a id="section_wgq_5lq_rkb"></a>
PMD Scripting provides a console object that receives logging messages from PMD scripts and sends them to the Workday Extend logs. A `console` variable is available in the script to log messages at different logging levels.

For details about viewing `console` log entries, see [Console Log Entries](/wcp_docs/baq1581495151995.html#section-console-log-entries).

## <a id="section_consoleMethods"></a>Console Methods

-   <b>debug(Object... messages)</b>

    Return type: `void`

    Description: Log the specified debug level messages.

    Example: `console.debug('Debug the current value: ', self.value);`

-   <b>error(Object... messages)</b>

    Return type: `void`

    Description: Log the specified error level messages.

    Example: `console.error('Invalid value error: ', self.value);`

-   <b>info(Object... messages)</b>

    Return type: `void`

    Description: Log the specified informational level messages.

    Example: `console.info('Informational value: ', self.value);`

-   <b>warn(Object... messages)</b>

    Return type: `void`

    Description: Log the specified warning level messages.

    Example: `console.warn('Warning value: ', self.value);`



## <a id="section_consoleNotes"></a>Notes

-   Don't include sensitive user data in the log messages that you send to the console.
-   The `console` methods don't return a value. Because the last line of a PMD script is the return value, you can't place a `console` method on the last line of a PMD script.

    This sample script returns an empty value because the `console.debug` method doesn't return a value.

    ```
    "value": "<% getStaticText(); 
                 console.debug('This is the last line.') 
              %>"
    ```

    If you want to log the return value of the script on the console, ensure that the last line returns the value after the `console` method call. Example:

    ```
    "value": "<% var result = getStaticText();
                 console.info(result);
                 result;
              %>"
      
    ```

-   In a Development tenant, when a custom app loads a page and encounters a PMD script failure, the page error includes details about the script error. You can find the same error details in the logs where `wd_category` is `pageError.script`.


## <a id="section-console-log-entries"></a>Console Log Entries

On the <b>Analytics</b> &gt; <b>Logs</b> section of the Workday Developer Site, add this filter:

`wd_category is console`

You can also filter the logs using these field values:

<table><thead><tr><th>Log Field</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td><code>wd_category</code></td><td><code>scriptUsage</code></td><td>Displays CPU and memory usage from a script execution.</td></tr><tr><td><code>wd_category</code></td><td><code>pageError.script</code></td><td>Returns PMD script exception messages.</td></tr><tr><td><code>wd_level</code></td><td><ul><li><code>DEBUG</code>
</li><li><code>INFO</code>
</li><li><code>WARN</code>
</li><li><code>ERROR</code>
</li></ul></td><td>Returns log entries with the specified log level. The log level corresponds to the <code>console</code> method called by the PMD script.</td></tr><tr><td><code>wd_common_request_id</code></td><td><code>VPS|{commonRequestIdValue}</code></td><td>Returns log entries associated with the request ID. If your app encounters a page error, you can copy the common request ID from the error message.</td></tr></tbody></table><br/>

### Related Information

[View Page Errors in the Logs](/wcp_docs/rlh1588897123576.html)

[Reference: Logs](/wcp_docs/hlt1558652308211.html)

