# Custom script messages for logs

## Introduction

When testing and debugging scripts, it can be useful to write specific information to logs after the script has finished processing.&#x20;

You can do this by adding a `logs` array key to a script, with required output added as strings - for example:

{% code title="PHP" overflow="wrap" lineNumbers="true" %}

```php
function handle($data)
{
    $data['logs'] = ["Log message 1", "Log message 2"];
    return $data;
}
```

{% endcode %}

...is output as:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FQFBZmnzWcW8Pvi4kzErJ%2Fscript%20logs%20example.png?alt=media&#x26;token=14f5b2f1-56b6-42ca-a617-6242e858ac85" alt=""><figcaption></figcaption></figure>

## Need to know

* Log messages must be strings.
* A maximum of 500 characters (in total) is allowed.
* Use with care (especially in loops) as logs are output every time the script runs.
