Documentation Index
Fetch the complete documentation index at: https://docs.compartment.dev/llms.txt
Use this file to discover all available pages before exploring further.
compartment logs retrieves log output from the active deployment of one or more services in a Compartment environment. Each log line includes a timestamp, the service name, and the stream it came from — compartment (platform events), stdout, or stderr. Pass --follow to keep the stream open and continuously poll for new lines until you press Ctrl+C.
Usage
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--project <name> | string | — | Project to query. Defaults to the name in compartment.yml when run from a project directory. |
--env <name> | string | production | Environment whose active deployment to read logs from. |
--service <name> | string | — | Limit output to a single named service. |
--follow | boolean | false | Poll for new log lines and keep streaming until the process is interrupted. Cannot be combined with --output json. |
--verbose | boolean | false | Print deployment details above the log lines. |
--output <format> | text | json | text | Output format for the fetched log snapshot. Not compatible with --follow. |
Log streams
Compartment captures three distinct streams for every deployment:| Stream | Description |
|---|---|
compartment | Platform-level events — container lifecycle, health checks, and promotion stage transitions. |
stdout | Standard output written by your application process. |
stderr | Standard error written by your application process. |
Examples
--follow and --output json cannot be used together. If you need machine-readable output, omit --follow and capture the snapshot with --output json instead.