Logs
Viewing application logs in StrictOps
Logs
StrictOps provides access to your application logs through CloudWatch Logs integration. You can view logs directly in the StrictOps console or query them via the API.
How Logs Work
When your application runs on ECS Fargate:
- Container stdout/stderr is captured by the ECS agent
- Logs are sent to CloudWatch Logs in your AWS account
- StrictOps queries CloudWatch using your AWS connection
- Logs are displayed in the console or returned via API
Log Organization
Logs are organized by:
| Dimension | Description |
|---|---|
| Stack ID | CloudFormation stack identifier |
| Service | Service name from strictops.yml |
| Environment | Deployment environment (production, staging, etc.) |
| Container | Individual container instance |
Querying Logs
Required Parameters
| Parameter | Description |
|---|---|
stackId | CloudFormation stack ID (from deployment) |
roleArn | AWS IAM role ARN for cross-account access |
externalId | External ID for role assumption |
Optional Parameters
| Parameter | Description | Default |
|---|---|---|
region | AWS region | us-east-1 |
startTime | Start time (Unix timestamp in ms) | Last 15 minutes |
endTime | End time (Unix timestamp in ms) | Now |
filterPattern | CloudWatch filter pattern | None |
limit | Maximum log events to return | 100 |
nextToken | Pagination token | None |
Filter Patterns
You can filter logs using CloudWatch filter pattern syntax:
| Pattern | Matches |
|---|---|
ERROR | Lines containing "ERROR" |
"Connection refused" | Lines containing the exact phrase |
?ERROR ?WARN | Lines containing "ERROR" or "WARN" |
[timestamp, level=ERROR, ...] | Structured log parsing |
See CloudWatch filter pattern syntax for full documentation.
Pagination
Large log queries return paginated results:
- First request returns logs and a
nextToken - Pass
nextTokenin subsequent requests to get more logs - When
nextTokenis null, all logs have been retrieved
Log Retention
Log retention is configured in your AWS account's CloudWatch settings. StrictOps does not modify retention policies. The default ECS log retention is 30 days.
Viewing Logs in the Console
The StrictOps console provides a log viewer for each deployment:
- Navigate to your deployment
- Click the "Logs" tab
- Use the time range selector and filter input
- Logs stream in real-time for running deployments
API Reference
See the Logs API in Swagger for endpoint details and request/response schemas.
Relationship to Other Entities
- Deployments provide the
stackIdneeded to query logs - AWS Connection provides credentials to access CloudWatch
- Services determine log group naming
- Environments separate log groups for each environment