How to Save Logs
Last updated
Was this helpful?
Last updated
Was this helpful?
When you create a deployment, your container generates logs. You can save these logs to an S3 Bucket of your choice once you terminate your deployment. By setting up an Endpoint Storage, you will be able to retrieve these logs at any time, even after the deployment has been terminated.
To accomplish this, you will need to link your App Version to your Endpoint Storage. Navigate to the App Version details page, and look for the Container Logs Storage section. Enable the switch box and select your Endpoint Storage in the select box.
If you enable container logs storage without selecting a valid Endpoint Storage, you will not be able to retrieve your logs. To ensure you have a valid Endpoint Storage, please refer to the setup documentation.
That's it! Every deployment with this application version will now store the container logs in your S3 Bucket.
The path in your S3 Bucket will look like this.
edgegap/arbitrium
The first part of your client email, most S3 browsers don't like "@"
The name of your Endpoint Storage
app / app version / container_log
The date YYYY-MM-DD
You can create multiple Endpoint Storage with the same S3 Bucket but with a different name. That way, you could have various directories for numerous environments if you wanted.
These use cases can be useful when testing, and you don't want all of your deployments logs sent to storage.
Save container logs with your Deployment request
When you create a deployment, you can specify if you want to store your container logs with your Deployment request. This independent of the application version settings, meaning that it is not necessary to have previously set up the Endpoint Storage with your application version, but simply to have a functional Endpoint Storage.
You can do this by adding the following JSON to your Deployment request. The endpoint_storage
is the name of your Endpoint Storage.
If the endpoint_storage
is not provided, we'll attempt to use the app version's endpoint storage. If no endpoint storage is found, container logs won't be stored.
Save container logs with your Stop request
Another convenient way to use it is when you terminate your deployment. If you have reason to believe something went wrong inside your container, you can request to save the container logs. This option is available with the Deployment stop and Self stop routes.
You can do it by adding the query parameter container_log_storage
to your request. The param container_log_storage
is the name of your Endpoint Storage. You can also put true
to use the app version's endpoint storage.
You can check our API Documentation for more details on the deployment and stop request parameters.