Logs
The Logs view provides access to your application's logs, which is essential for debugging and monitoring your environments. The logs are separated into categories: web
, cronjob
, shell
, worker
, deployment
, and all
. You can filter the logs by selecting the desired category.
General features
You get logs for each environment separately. The logs are displayed in real-time and are retained for a certain period, depending on your subscription plan. You can:
- Timezone: Set your timezone to display the logs in your local time.
- Start date: Select the start date for the logs.
- End date: Select the end date for the logs.
- Type: Filter the logs by selecting the desired category.
- Theme: Switch between light and dark mode.
More logs
The web interface for logs has limitations, such as a limited search functionality and the number of lines displayed. You can use the Divio CLI or the API directly if you need to access more logs.
Logs through the Divio CLI
You can access the logs through the Divio CLI by running the following command from within your applications directory:
divio app logs --tail live
Or by specifying the application UUID:
divio app logs --remote-id UUID --tail live
Replace the UUID with the application's UUID. You can get this from the URL in the application view or the Developer menu in the help icon on the bottom left of the Divio Control Panel. Also, ensure you are logged in through divio login
and have the necessary permissions to access the logs.
Logs through the API
You can access the logs through the API by running the following command within your terminal:
curl "https://api.divio.com/apps/v3/environments/UUID/logs/" -H "authorization: Token TOKEN"
Replace UUID with the environment UUID and TOKEN with your API token. You can get your API token from the account settings and the environment UUID from the Developer menu in the help icon on the bottom right of the Divio Control Panel.
Append the following query parameters to the URL to filter the logs:
curl "https://api.divio.com/apps/v3/environments/UUID/logs/?from_ts=2024-04-17T11%3A53%3A47.649Z&to_ts=2024-04-18T11%3A53%3A47.649Z" -H "authorization: Token TOKEN"
You can find more about the API in the API documentation.
Application logs
Your application's logs, written to stdout
and stderr
, are a powerful tool for debugging, performance monitoring, and tracking execution. Rest assured, you're in control. Just remember to keep an eye on the volume of logs to maintain optimal performance.