# Digital Ocean Apps

## Start logging in 3 minutes

Collect logs from your [Digital Ocean Apps](https://docs.digitalocean.com/products/app-platform/).

### Set up Better Stack Digital Ocean source

1. Go to the [Better Stack → Sources](https://telemetry.betterstack.com/team/0/sources) → **Connect source**.
2. Name your source and select **Digital Ocean** as **Platform**.
3. Click the **Create source** button.
4. Copy the **Source token** from the **Basic information** section.

### Set up Digital Ocean App

1. Go to your [Digital Ocean → Apps](https://cloud.digitalocean.com/apps).
2. Select your app and click the **Settings** tab.
3. Click **Log forwarding** → **Edit** → **Add new destinations** → **+ Logtail**.
4. Fill in **Destination name** and paste your Better Stack **Source token** into the `Token` field.
5. Select the app resources to collect logs from.
6. Click **Add Log Destination**, and you're done. 🎉

You should see your logs in [Better Stack → Logs & traces](https://telemetry.betterstack.com/team/0/tail).

![digital_ocean_log_forward.png](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/3a57afcc-769a-4a22-795b-6dfd1e34cf00/md1x =677x606)

[info]
#### Using Digital Ocean Ubuntu droplets?
Follow our [Ubuntu log forwarding guide](https://betterstack.com/docs/logs/ubuntu/) to collect Logs & Metrics from the managed Ubuntu droplets.

#### Using Digital Ocean Functions? 
Follow our [Digital Ocean Functions log forwarding guide](https://betterstack.com/docs/logs/digital-ocean-apps/#forward-logs-from-digital-ocean-functions).
[/info]

## Seeing incomplete logs in Live tail?

Digital Ocean has a hard set limit to the bytes-per-row at 2000B for log forwarding. This may cause some information in your logs to be omitted.

To avoid this limit, you can split your longer logs into multiple records, or implement logging directly in your app and skip Digital Ocean forwarding. This would give you greater control over the format of your logs.

For example, see [logging directly from Javascript app](https://betterstack.com/docs/logs/javascript/).

## Forward logs from Digital Ocean Functions

Digital Ocean Functions forward logs using an HTTP API sink instead of Rsyslog. To set this up, you need an HTTP source.

### Create an HTTP source

1. Go to [Better Stack → Sources](https://telemetry.betterstack.com/team/0/sources) → **Connect source**.
2. Select the **Logs & Metrics** tab.
3. Scroll to the **Other** section and select **HTTP**.
4. Name your source and click **Connect source**.
5. Copy the **source token** from the source details.

### Configure log forwarding

Add the `LOG_DESTINATIONS` environment variable to your `project.yml` file:

```yaml
[label project.yml]
environment:
  LOG_DESTINATIONS: '[{"telemetry":{"token":"$SOURCE_TOKEN"}}]'
```

You can set `LOG_DESTINATIONS` at project, package, or function scope depending on which functions you want to forward logs from.

[info]
You can forward logs to multiple destinations at once by adding more entries to the JSON array and by creating more HTTP sources. 
[/info]

### Deploy and verify

Deploy your project and check [Better Stack → Live tail](https://telemetry.betterstack.com/team/0/tail) to see your function logs.
