lift logs
View Docker container logs with real-time streaming, tail configuration, and automatic container detection from .lift.json.
lift logs
View Docker container logs on the server. Supports real-time streaming, tail length configuration, and auto-detection of the container from your .lift.json config.
Options
| Flag | Description | Default |
|---|---|---|
-f, --follow | Follow log output in real-time (stream mode) | |
--tail <n> | Number of lines to show from the end | 100 |
--tool <name> | View logs from a tool's Docker Compose stack | |
--container <name> | View logs from a specific container by name | |
--since <duration> | Show logs since duration (e.g. 1h, 30m, 2h30m) | |
--grep <pattern> | Filter log lines by pattern (case-insensitive) | |
--format <type> | Output format: text, json, csv | text |
Examples
# Auto-detect container from .lift.json
lift logs
# Stream logs in real-time
lift logs -f
# Show last 50 lines of a specific tool
lift logs --tool redis --tail 50
# View a specific container on a remote server
lift logs --container postgres-app --server 1.2.3.4
# Show logs from the last hour
lift logs --tool redis --since 1h
# Filter logs by pattern
lift logs --container redis-app --grep "error"
# Export logs as JSON
lift logs --tool redis --format json
Note:
--formatis ignored in follow mode (-f), which always streams text output.
ℹ Container Auto-Detection: When run from a directory with
.lift.json, Lift automatically resolves the container name fromappName. No flags needed.
Related
- lift status - Check container status
- lift exec - Execute commands in containers
- lift push - Deploy your application