Logs Reference
Jiji provides unified log viewing across all services and servers, plus comprehensive audit trails for deployment tracking.
Log Levels
Jiji supports multiple log levels that can be configured globally or per-command:
| Level | Description |
|---|---|
debug | Detailed debugging information |
info | General information |
warn | Warnings |
error | Errors only |
fatal | Critical failures only |
success | Success messages |
trace | Detailed trace (most verbose) |
Global Options
jiji -v deploy # Verbose mode (debug level)
jiji -q deploy # Quiet mode (warn level only)SSH Logging
SSH logging can be configured in your deploy.yml:
ssh:
log_level: error # debug | info | warn | error | fatalService Logs
View logs from your deployed services:
jiji services logsFiltering Options
| Option | Short | Description |
|---|---|---|
--services | -S | Filter by service name (supports wildcards) |
--hosts | -H | Filter by host (supports wildcards) |
--lines | -n | Number of lines to show |
--since | Show logs since time | |
--grep | Filter by pattern | |
--follow | -f | Stream logs in real-time |
--quiet | -q | Minimal output |
--container-id | Show container IDs in output |
Examples
View recent logs:
jiji services logs -n 100Filter by service:
jiji services logs -S api
jiji services logs -S "api,worker"
jiji services logs -S "web*"Filter by host:
jiji services logs -H web1
jiji services logs -H "prod*"Time-based filtering:
jiji services logs --since 30m # Last 30 minutes
jiji services logs --since 2h # Last 2 hours
jiji services logs --since 1d # Last daySearch logs:
jiji services logs --grep "error"
jiji services logs --grep "ERROR|WARN"
jiji services logs -S api --grep "timeout"Stream logs:
jiji services logs -f
jiji services logs -S api -f --grep "request"Combined filters:
jiji services logs -S api -H "prod*" --since 1h --grep "ERROR" -n 50Proxy Logs
View kamal-proxy logs for HTTP routing information:
jiji proxy logsSupports the same filtering options as service logs.
Examples
View proxy logs:
jiji proxy logs -n 100Filter by host:
jiji proxy logs -H web1Search for errors:
jiji proxy logs --grep "error"
jiji proxy logs --grep "502|503|504"Stream proxy logs:
jiji proxy logs -fLog Output Format
Default output includes:
- Timestamp
- Host name
- Service name
- Log message
With --container-id:
- Container ID is prepended to each line
With --quiet:
- Only log messages, no metadata
Audit Trail
The audit trail provides a comprehensive history of all operations performed by Jiji.
Viewing Audit Logs
jiji audit
jiji audit --lines 50Audit Log Location
Audit logs are stored on remote hosts at:
/var/log/jiji/{project}/Filtering Options
| Option | Short | Description |
|---|---|---|
--lines | -n | Number of recent entries (default: 20) |
--filter | Filter by action type | |
--status | Filter by status | |
--since | Show entries since date | |
--until | Show entries until date | |
--raw | Show raw format | |
--json | Output as JSON | |
--follow | -f | Follow like tail -f |
--aggregate | Combine logs chronologically from all hosts |
Action Types
Filter by specific action types:
deploy- Deployment operationsbuild- Build operationslock- Lock acquire/releaserestart- Service restartsremove- Service removalsprune- Image cleanup
Status Values
Filter by operation status:
started- Operation startedsuccess- Operation completed successfullyfailed- Operation failedwarning- Operation completed with warnings
Examples
View recent audit entries:
jiji audit
jiji audit --lines 50Filter by action:
jiji audit --filter deploy
jiji audit --filter buildFilter by status:
jiji audit --status success
jiji audit --status failedDate range filtering:
jiji audit --since 2024-01-01
jiji audit --since 2024-01-01 --until 2024-01-31Real-time monitoring:
jiji audit --follow
jiji audit -f --filter deployJSON output for scripting:
jiji audit --json
jiji audit --json --filter deploy --status failedAggregate logs from all hosts:
jiji audit --aggregateAudit Entry Contents
Each audit entry includes:
- Timestamp
- Action type
- Status (started/success/failed/warning)
- User or CI that triggered the operation
- Services affected
- Version information
- Duration (for completed operations)
- Error messages (for failed operations)
Direct Container Logs
For more control, access container logs directly:
jiji server exec "docker logs <container-id>"
jiji server exec "docker logs --tail 100 -f <container-id>"Component Logs
jiji-dns Logs
jiji server exec "journalctl -u jiji-dns -f"
jiji server exec "journalctl -u jiji-dns --since '1 hour ago'"Corrosion Logs
jiji server exec "journalctl -u jiji-corrosion -f"
jiji server exec "journalctl -u jiji-corrosion --since '1 hour ago'"WireGuard Logs
jiji server exec "journalctl -u wg-quick@jiji0 -f"kamal-proxy Logs
jiji proxy logs
jiji proxy logs -H web1 -fLog Aggregation
For production environments, consider forwarding logs to a centralized system.
Docker Log Driver
Configure in your service:
services:
api:
# ... other config
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"Syslog Forwarding
jiji server exec "docker logs <container> | logger -t myapp-api"Third-Party Integrations
Common log aggregation solutions:
- Datadog
- Papertrail
- Logtail
- Grafana Loki
- ELK Stack
Configure your containers to send logs to these services using their respective log drivers or agents.
Troubleshooting
No logs appearing
# Check if container is running
jiji server exec "docker ps" -H web1
# Check container directly
jiji server exec "docker logs <container-id>"Logs truncated
Increase the line limit:
jiji services logs -n 1000Old logs not available
Docker rotates logs. Check log driver settings:
jiji server exec "docker inspect <container> | grep -A10 LogConfig"Finding container IDs
# List running containers
jiji server exec "docker ps"
# Show container IDs in logs
jiji services logs --container-id