Files
computer-playbook/scripts/tests/deploy/local/exec/logs.sh
kevinveenbirkenbach 5bf49c66e3 feat(make): add compose-app-logs for reaching a deployed container's logs
Diagnosing a failing app meant reading its container logs, and the only
route to them was raw docker. The target mirrors compose-app-exec and
goes through the same container wrapper, so the log route is no wider
than the exec route already is.
2026-08-09 22:53:07 +02:00

22 lines
730 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Dump the logs of a deployed app container of the local compose stack, through
# the repository's own `container` wrapper.
#
# Usage:
# app=<container> [tail=<lines>] scripts/tests/deploy/local/exec/logs.sh # nocheck: self-path-reference
#
# Environment:
# app Container name of the deployed app (e.g. litellm).
# tail Number of trailing lines to print. Default: 200.
#
# Examples:
# app=litellm tail=80 scripts/tests/deploy/local/exec/logs.sh # nocheck: self-path-reference
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
: "${app:?app=<container> required, e.g. app=litellm}"
exec bash "${SCRIPT_DIR}/container.sh" container logs --tail "${tail:-200}" "${app}"