# How to Forward Logs Functions are blocks of code that run on demand without the need to manage any infrastructure. Develop on your local machine, test your code from the command line (using `doctl`), then deploy to a production namespace or App Platform — no servers required. You can configure functions to forward console and error logs from the function to a third-party logging service. Functions supports Papertrail, Datadog, and Logtail. To configure your function to ship logs to a third party, you need to define a `LOG_DESTINATIONS` environment variable for it. This environment variable goes in your `project.yml` file and contains a JSON string with details on the log forwarding destination. The JSON string is a JSON version of the `log_destinations` field of App Platform’s [App Spec](https://docs.digitalocean.com/products/app-platform/reference/app-spec/index.html.md) YAML file. You may use the [App Spec reference](https://docs.digitalocean.com/products/app-platform/reference/app-spec/index.html.md) for more details on the configuration required. **Note**: In App Platform, you configure Papertrail using a syslog endpoint. Functions requires an HTTP source token when using Papertrail. ## Examples The following examples show how to configure the `LOG_DESTINATIONS` environment variable in your `project.yml` file. The `LOG_DESTINATIONS` line belongs under an `environment:` key at whichever scope is appropriate for your situation: project, package, or function. See the [`project.yml` reference](https://docs.digitalocean.com/products/functions/reference/project-configuration/index.html.md) for more information about scopes and setting environment variables. ### Papertrail For Papertrail, create a log destination that accepts token-based authentication over HTTPS. This setting is under the **Accept connections via…** heading on [Papertrail’s Create Log Destination page](https://papertrailapp.com/destinations/new). Refer to [Papertrail’s log destinations documentation](https://www.papertrail.com/help/log-destinations/) for more details. Use the provided token in your configuration: ```yaml LOG_DESTINATIONS:'[{"papertrail":{"token":""}}]' ``` ### Datadog For Datadog, the configuration requires an endpoint URL and an API key: ```yaml LOG_DESTINATIONS:'[{"datadog":{"endpoint":"https://http-intake.logs.datadoghq.com","api_key":""}}]' ``` ### Logtail For Logtail, [create an HTTP source](https://docs.logtail.com/integrations/rest-api) and use the resulting token for the configuration: ```yaml LOG_DESTINATIONS:'[{"logtail":{"token":""}}]' ``` ### Multiple Destinations The `LOG_DESTINATIONS` JSON structure is a list, so you can configure multiple log destinations: ```yaml LOG_DESTINATIONS:'[{"papertrail":{"token":""}},{"logtail":{"token":""}}]' ```