Skip to main content

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

compartment logs [options]

Options

FlagTypeDefaultDescription
--project <name>stringProject to query. Defaults to the name in compartment.yml when run from a project directory.
--env <name>stringproductionEnvironment whose active deployment to read logs from.
--service <name>stringLimit output to a single named service.
--followbooleanfalsePoll for new log lines and keep streaming until the process is interrupted. Cannot be combined with --output json.
--verbosebooleanfalsePrint deployment details above the log lines.
--output <format>text | jsontextOutput format for the fetched log snapshot. Not compatible with --follow.

Log streams

Compartment captures three distinct streams for every deployment:
StreamDescription
compartmentPlatform-level events — container lifecycle, health checks, and promotion stage transitions.
stdoutStandard output written by your application process.
stderrStandard error written by your application process.
Each line is labelled with its stream so you can distinguish application output from platform events at a glance.

Examples

compartment logs
--follow and --output json cannot be used together. If you need machine-readable output, omit --follow and capture the snapshot with --output json instead.
Press Ctrl+C to stop a --follow session cleanly. The CLI exits gracefully without printing an error.