Skip to Content

Logs Reference

Jiji has two logging commands - jiji service logs for your deployed services, and jiji proxy logs for jiji-proxy - plus jiji audit for the deployment audit trail. All three support filtering and following logs across multiple servers.

Service Logs

jiji service logs tails the Active catalog deployment for each selected replica.

jiji service logs -S web jiji service logs -S "web,api,worker" jiji service logs -S "web*"

Omit -S/--services to tail every service. --container-id can’t be combined with -S.

Options

OptionDescription
-n, --lines <N>Lines to show from each server
-s, --since <time>Show logs since a timestamp or relative duration (30m, 2h, 1d, or ISO 8601)
-g, --grep <pattern>Filter lines by pattern
--grep-options <opts>Extra flags passed to grep (-i, -v, -E, -C 5, …)
-f, --followFollow in real time (requires exactly one target)
--container-id <id>Fetch logs from an arbitrary container name, bypassing service config
-H, --hosts <pattern>Target specific hosts (global flag)
-q, --quietSuppress host headers, lower log verbosity (global flag)
jiji service logs -S web --since 30m jiji service logs -S api --grep "ERROR" jiji service logs -S web --grep "warning" --grep-options "-i" jiji service logs -S api --follow -H server1.example.com jiji service logs --container-id abc123def456

Quiet mode drops the [server1.example.com]-style host headers and reduces noise, useful when piping into another command:

jiji service logs -S web -q | grep -i warning | wc -l

Proxy Logs

jiji proxy logs reads from the jiji-proxy container that handles HTTP, HTTPS, and raw TCP routing.

jiji proxy logs jiji proxy logs -n 50 jiji proxy logs --follow

Same option set as service logs: -n/--lines, -s/--since, -g/--grep, -f/--follow, -H/--hosts.

# Debugging routing jiji proxy logs --grep "404" jiji proxy logs --grep "HTTP/[0-9]\.[0-9]\" [45][0-9][0-9]" --grep-options "-E" # Traffic to one service jiji proxy logs --grep "web-app"

If a service isn’t receiving traffic, check proxy logs before service logs

  • it tells you whether jiji-proxy is routing to it at all.

Common Use Cases

# Errors in the last hour, with context jiji service logs -S api --since 1h --grep "ERROR" --grep-options "-C 5" # Track one request across a service jiji service logs -S api --grep "request_id=abc123" # Compare the same service across two servers jiji service logs -S web -H server1.example.com jiji service logs -S web -H server2.example.com # Count errors in the last hour (scripting, needs -q for clean output) jiji service logs -S web --since 1h --grep "ERROR" -q | wc -l # SSL/TLS issues at the proxy jiji proxy logs --grep "ssl\|tls\|certificate" --grep-options "-E"

Best Practices

  • Prefer relative --since values (30m, 2h) over exact timestamps - easier to write and they stay correct as time passes.
  • Combine --since and --grep rather than scanning full output: jiji service logs -S api --since 1h --grep "ERROR".
  • Check proxy logs before service logs when a service isn’t receiving traffic - it tells you whether jiji-proxy is routing to it at all.
  • Use -q/--quiet whenever output is being piped into grep, wc, or a script, so host headers don’t pollute the stream.

Log Output Format

Timestamps come from Docker/Podman in ISO 8601:

2023-12-22T15:30:45.123456789Z [INFO] Application started 2023-12-22T15:30:46.234567890Z [ERROR] Connection failed

Audit Trail

jiji audit reads the append-only JSONL trail at .jiji/{project}/audit.log on each selected server. Current writers are deploy, service restart/rollback/remove/prune/scale, server setup/teardown/upgrade, network setup/compact/restore, registry login/logout, proxy restart, server exec, service cron run, jiji build (the builder.remote path only), and lock acquire/release. registry teardown, local registry login/logout, and network recover are local-only operations with no remote host to audit against, and are unaudited by design — the same reason a local jiji build writes no entry.

jiji audit jiji audit --lines 50 jiji audit --grep deploy jiji audit --status success jiji audit --json jiji audit --stats jiji audit --stats --since 24h jiji audit --follow
OptionDescription
-n, --lines <N>Entries to show per server (default: 20)
-g, --grep <pattern>Filter entries by action or message (substring match)
--status <success|failed>Filter by status
--jsonNewline-delimited JSON output, or one structured object with --stats
--statsOverall, per-action, and per-server success-rate and average-duration rollup
-s, --since <window>Limit --stats to a relative window such as 30m, 12h, or 7d (requires --stats)
-f, --followFollow the trail as new entries land (requires exactly one host)

-S/--services is rejected - the trail is host-scoped, not service-scoped, matching jiji lock. Malformed lines are skipped rather than treated as a hard error, so one bad write never makes the whole trail unreadable.

Each entry is one JSON object: timestamp, action, status, actor, message, duration_ms - how long the operation took, captured from command start to the audit write (omitted on entries written before this field existed, or if there’s no start time to measure from). Shown next to the action name in the default output, and included in --json output. Audit writes are best-effort - a failed write is warned about, never propagated, so audit logging can’t mask or block the actual outcome of the command it’s recording.

jiji audit --stats reads each selected host’s full live audit log on every invocation (there is no local cache) and reports overall, per-action, and per-server entry counts, success rates, and average durations. Entries written before duration_ms existed still count toward totals and success rates, but are excluded from the average duration; the output reports how much of the entry set that timed coverage represents. --since scopes the window to something like 30m, 12h, or 7d; --stats cannot be combined with --lines or --follow. With --stats --json, Jiji emits one structured object with overall, by_action, and by_server aggregates instead of per-line entries.

# Recent failed operations jiji audit --status failed # Everything related to a rollback jiji audit --grep rollback --lines 50 # Success rate and average duration over the last 7 days jiji audit --stats --since 7d

Troubleshooting

Container not found: confirm the service is actually deployed (jiji deploy -S web), running on the target host, and that you’re targeting the right host with -H.

No logs displayed: check whether the container is producing output at all, widen --since, and confirm --grep isn’t filtering everything out.

Follow mode not working: verify the SSH connection to the target host, that the container is running, and that your SSH user has container-engine access (the docker group, or Podman socket access).

Examples

# Debugging workflow jiji service logs -S web --since 5m jiji service logs -S web --grep "ERROR" jiji proxy logs --grep web jiji service logs -S web --follow # Across services and servers jiji service logs -S "api*" --grep "ERROR" jiji service logs -S web -H server1.example.com # Production monitoring jiji service logs -S "web,api,worker" --grep "CRITICAL|FATAL" --grep-options "-E" --follow
Last updated on