Searching Logs in AWS CloudWatch
Learn how to search through Code Ocean VPC logs in AWS CloudWatch.
Learn how to search through Code Ocean VPC logs in AWS CloudWatch.
Code Ocean VPC sends its logs to AWS CloudWatch Logs. There are 3 log groups:
[acmecorp]/instances
- Contains all EC2 instances' OS logs.
[acmecorp]/services
- Contains Code Ocean's services logs. Each service has its own log stream (e.g. services/codeocean_[service_name]_1
).
[acmecorp]/workers
- Contains all workers logs. Each executed capsule run would have its own log stream with the computation ID (e.g. worker/runner/[computation_id]
).
Viewing Code Ocean log data can help in troubleshooting the system or deployment issues.
The simplest way would be through the search bar in the top of every log stream.
If you are not sure which log stream you need, use the Search all button in the top right corner of the Log group.
You can also use CloudWatch Logs Insights to search the logs. The Logs Insights offers faster query times and allows for more complex queries. Note that this service can incur additional costs in your AWS account.
Under CloudWatch Logs, go to Insights tab
Choose the relevant log group, time frame, and under the query pane enter the selected query. For example, the following query will display all critical log level errors: