App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.
You can view activity, build, deployment, and runtime logs in App Platform using the control panel, CLI, and API. You can also enable log forwarding to forward application logs to external log providers.
App Platform records several different types of information about your app to during each stage of its deployment. You can access and review the following logs:
The CLI command and API endpoint used to retrieve an app’s logs require the app’s ID. You can retrieve a list of your apps and their IDs using the
doctl apps list command or the /v2/apps endpoint.
To view logs via the command-line, follow these steps:
doctl, the DigitalOcean command-line tool.
personal access token, and save it for use with
Use the token to grant
doctl access to your
doctl auth init
Finally, view logs with
doctl apps logs. The basic usage looks
like this, but you'll want to read the usage docs for more details:
doctl apps logs <app id> <component name (defaults to all components)> [flags]
To view logs using the DigitalOcean API, follow these steps:
Create a personal access token, and save it for use with the API.
To view logs with cURL, call:
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_logs(app_id="4f6c71e2", deployment_id="3aa4d20e", component_name="component")
live_url returned may use either the
wss:// protocols and will keep pushing live logs as they become available.
To view app resource logs, click Apps in the left menu and then click your app.
To view the activity for an app, click the Activity tab. This displays your app’s timeline of deployments.
To view logs and information for a specific deployment, click the Activity tab and then click the deployment link in the headline of the deployment you want to review. From here, you can review the deployment’s Build logs and Deploy logs.
To view runtime logs, click the Runtime Logs tab, then click a resource to view its logs. The logs show within a few minutes after the app deploys. The logs are updated in real time while the resource is running.
Crash logs are available after a container crashes and restarts. You can only access crash logs using
doctl, the official DigitalOcean CLI.
To access the log from before the last crash, run the following command in a terminal, replacing
<your-app-ID> with your app’s ID:
doctl apps logs <your-app-ID> --type=run_restarted
To retrieve a list of app IDs, run
doctl apps list.
Optionally, you can retrieve crash logs for a specific component by adding the component’s name as an additional argument, like this:
doctl apps logs <your-app-ID> <component-name> --type=run_restarted