/kamal-skills:loggingfrom kamal-skills
Configure how logs flow in a Kamal deployment — the Docker logging driver and options for your app containers (the `logging:` key, where `driver` is passed to Docker as `--log-driver` and `options` as `--log-opt`, e.g. `json-file` with `max-size`), and Kamal's own output loggers that ship deploy/command logs to an OpenTelemetry endpoint or write them to a file on disk (the `output:` key, with `otel.endpoint` and `file.path`). Use when the user says things like "configure Docker logging," "set a log driver," "rotate or cap container logs with max-size," "docker logs are filling the disk," "set logging per role," "ship deploy logs to OpenTelemetry/OTel/OTLP," "send Kamal logs to a collector," or "write deploy logs to a file." For viewing running app and accessory logs with `kamal app logs` / `kamal accessory logs`, see app. For where these keys sit in config/deploy.yml alongside other top-level options, see config.
Ships in kamal-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in deploying applications with Kamal. Your goal is to configure where logs go: the Docker logging driver and options for the containers Kamal runs on your servers, and Kamal's output loggers for the command output it produces while deploying.
Kamal has two distinct, independent logging settings. Keep them straight before you touch the config — they solve different problems and live under different keys.
| Concern | Key | Controls | Where it applies |
|---|---|---|---|
| Container logging | logging: | The Docker logging driver and --log-opt options for your app's containers | On your servers, per container |
| Output logging | output: | Where Kamal sends its own command output (deploy logs) | OTel endpoint and/or a file |
Use logging: when you care about your application's stdout/stderr inside Docker (rotation, size caps, shipping container logs to a driver). Use output: when you want a durable record of what Kamal itself did during a deploy.
Inspect the existing configuration before asking the user questions:
config/deploy.yml — check for an existing logging: or output: block, the service: name, and the roles under servers: (you may want logging per role).config/deploy.<destination>.yml for overrides.Use what you find, then only ask for what's missing (which driver, what size cap, where to ship deploy logs).
logging:)The logging: key controls the Docker logging driver and options. Kamal passes these straight through to Docker, so any driver and any option Docker accepts are valid here.
These settings can be specified at the root level or for a specific role.
The logging driver is passed to Docker via --log-driver:
logging:
driver: json-file
json-file is the driver used in the Kamal docs. Because the value is handed directly to Docker, see Docker's logging driver documentation for the full catalog of available drivers.
Any logging options are passed to the driver via --log-opt. Each entry under options: becomes one --log-opt key=value:
logging:
driver: json-file
options:
max-size: 100m
This is the most common reason to reach for logging: — capping container log size so logs don't fill the disk. Which option keys are valid depends on the driver you chose (see the Docker logging docs linked above).
Set logging: at the root to apply it everywhere, or place it under a specific role in servers: to override the logging for just that role:
servers:
web:
- 192.168.0.1
workers:
hosts:
- 192.168.0.2
logging:
driver: json-file
options:
max-size: 100m
Configuring the driver is separate from reading the logs. To tail or fetch logs from running containers, use kamal app logs (and kamal accessory logs for accessories). Those runtime commands belong to the app skill — see Related Skills.
output:)The output: key configures where Kamal sends its own command output — the deploy logs. There are two output loggers: otel and file. You can configure either, or both, under the same output: key.
otel)Ship deploy logs to an OpenTelemetry-compatible endpoint via OTLP HTTP:
output:
otel:
endpoint: http://otel-gateway:4318
Logs are sent as OTLP log records, with resource attributes derived from Kamal's deploy tags — service, version, performer, destination, and similar. This lets your observability backend slice deploy logs by who deployed, which version, and which environment.
file)Write deploy logs to a file on the local machine (the machine running Kamal):
output:
file:
path: /var/log/kamal/
One log file is created per deploy, named with the timestamp and command. path is the directory those files are written into.
Since otel and file are independent loggers under output:, you can enable both — for example, ship to a collector and keep a local copy:
output:
otel:
endpoint: http://otel-gateway:4318
file:
path: /var/log/kamal/
The keys above are the complete set. At a glance:
| Key | What it does | Maps to / behavior |
|---|---|---|
logging.driver | Docker logging driver | docker run --log-driver |
logging.options | Driver options (map) | each becomes docker run --log-opt key=value |
output.otel.endpoint | OTLP HTTP endpoint for deploy logs | OTLP log records tagged with deploy attributes |
output.file.path | Directory for deploy log files | one file per deploy, named by timestamp + command |
For the full table with types, examples, and the OTel resource-attribute detail, see references/config-keys.md.
logging: is for your app's container logs (Docker driver/options). output: is for Kamal's own deploy/command logs (OTel/file). Setting the wrong one won't do what you expect.options: is forwarded as --log-opt, and valid option keys depend on the chosen Docker driver. Check Docker's docs for the driver you picked.logging: to let you read logs. It only configures the driver. Viewing logs is a separate runtime command (kamal app logs) — see app.kamal app logs (and kamal accessory logs), and other day-to-day app management commands.logging: and output: sit in config/deploy.yml, the other top-level options and their defaults, destinations (-d), and validating with kamal config.What SKILL.md sets; muted values are Claude Code's defaults
25 skills in this plugin
/accessoriesRun and manage accessory services — databases, Redis, search, and other long-lived dependencies your app needs — through Kamal's `accessories:` configuration and the `kamal accessory` command. Use this when the user says things like "add a MySQL/Postgres/Redis accessory," "run a database with Kamal," "kamal accessory boot," "set up a sidecar/companion service," "my app needs a cache or search container," "persist accessory data with volumes," or "reboot/restart/remove an accessory." Covers defining the accessory (image, host/hosts/role/roles/tag/tags, port, env, files, directories, volumes, network, options, registry, proxy) and operating it with boot, reboot, restart, start, stop, details, logs, exec, and remove. For passing configuration and credentials into accessories, see env and secrets. For scheduled jobs, see cron./aliasesDefine custom command aliases under the top-level `aliases` key in `config/deploy.yml` so a long, repeated `kamal` invocation becomes a single `kamal <name>`. Use it when the user says "add a Kamal alias," "shortcut kamal app exec," "make `kamal console` open a Rails console," "create a one-liner to deploy staging," "I keep retyping the same kamal command," or asks about the `aliases` config key, alias naming rules, or a `deploy -d staging` shortcut. Covers how an alias expands into a `kamal` subcommand, the lowercase letters/numbers/dashes/underscores naming rule, and the documented examples `console: app exec -i --reuse "bin/rails console"`, `uname: app exec -p -q -r web "uname -a"`, and `staging_deploy: deploy -d staging`. For the rest of `config/deploy.yml` and DRYing it up with YAML anchors, see config. For the underlying app exec / console / logs commands the aliases wrap, see app./appOperate and inspect already-running Kamal apps without redeploying. Manage app containers with `kamal app` (boot, start, stop, containers, details, images, version, logs, exec, remove, stale_containers), set maintenance/live mode (`kamal app maintenance --message`, `kamal app live`, `error_pages_path`), see every container with `kamal details`, review what ran on each server with `kamal audit`, print the resolved config with `kamal config`, run one-off and interactive commands with `kamal app exec` (`--primary/-p`, `--interactive/-i`, `--reuse`, `--raw`), and check the installed CLI version with `kamal version`. Use when the user says "boot/start/stop the app," "show running containers," "exec into the app," "open a Rails console," "run a command on all servers," "put the app in maintenance mode," "show the audit log," or "print my Kamal config." For shipping releases, see deploy. For reverting a release, see rollback. For log-driver and OTel/file config, see logging. For kamal-proxy, see proxy./buildConfigure Kamal builders and build then push your app image. Use this skill when the user wants to set up the `builder` block in config/deploy.yml — choosing local, remote, multi-arch, or Docker Build Cloud builds, picking a `driver`, passing build `args`, build `secrets`, or `cache`, switching the `dockerfile`, `context`, or `target`, or building without a Dockerfile via buildpacks (`pack`) — and when they want to run `kamal build push`, `kamal build dev`, or other `kamal build` subcommands. Trigger phrases include "kamal build," "build my image," "push the image to the registry," "build for amd64/arm64," "remote builder," "Apple Silicon cross-build is slow," "speed up my builds with cache," "pass a build arg," "use a build secret," or "build without a Dockerfile." For configuring the container registry, see registry. For the one-step flow that builds and ships in a single command, see deploy. For managing the secret values that build secrets reference, see secrets./ci-deploySet up continuous deployment so every push to main runs `kamal deploy` from GitHub Actions once the tests pass — for any stack Kamal ships (Rails, Next.js, Phoenix, Rust, static sites, and more). Use when the user says "auto-deploy on push," "deploy from GitHub Actions," "continuous deployment with Kamal," "deploy when CI passes," "set up CD," "stop deploying from my laptop," or "use 1Password in GitHub Actions." Covers the deploy ssh key, secrets in a GitHub environment or read from 1Password with a service account, the workflow, the GHA build cache, and verifying the first run. For running a deploy by hand, see deploy. For the secrets file itself, see secrets. For build cache options, see build./configUnderstand and write your Kamal configuration in config/deploy.yml. Use when the user says "set up config/deploy.yml," "what goes in my deploy.yml," "what are the required keys," "add a staging destination," "deploy with -d staging," "DRY up my config with YAML anchors," "what does retain_containers / readiness_delay / primary_role / deploy_timeout do," "kamal init," or "kamal config." Covers the required service and image keys, destinations (-d) and merged per-destination files, x- extensions, every top-level option and its default, and reusing config with anchors and aliases. For configuring servers and roles, see servers. For env and secrets, see env. For command shortcuts, see aliases. For a first deployment, see setup.npx claudepluginhub donnfelker/kamal-skills --plugin kamal-skillsOther plugins' skills for the same job