{
  "slug": "docker-local-logging-driver-supports-custom-attributes-d61274350eb2",
  "title": "Docker local logging driver supports custom attributes",
  "tools": [
    "docker"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-14T21:37:30.000Z",
  "announced_at": "2026-05-14T21:37:30.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When creating a container with Docker Engine 29.5.0 or later, use the `local` logging driver and specify the label, environment, or tag options to include custom log attributes.",
    "examples": [
      "docker run -d --name <container> --env=<KEY>=<VALUE> --label=<KEY>=<VALUE> --log-driver=local --log-opt env=<KEY> --log-opt labels=<KEY> --log-opt labels-regex=<REGEX> --log-opt 'tag=<TEMPLATE>' <image>"
    ],
    "gotchas": [
      "Version: 29.5.0",
      "--log-driver=local (required): Select the local logging driver.",
      "--log-opt labels=<KEY>[,<KEY>...]: Include the named container labels in log attributes. The release note calls this option `label`; the merged example uses `labels`.",
      "--log-opt labels-regex=<REGEX>: Include container labels matching the regular expression. The release note calls this option `label-regex`; the merged example uses `labels-regex`.",
      "--log-opt env=<KEY>[,<KEY>...]: Include the named container environment variables in log attributes.",
      "--log-opt env-regex=<REGEX>: Include environment variables matching the regular expression.",
      "--log-opt tag=<TEMPLATE>: Set the log tag using a template; the merged example uses `{{.ID}}`.",
      "--env=<KEY>=<VALUE>: Set a container environment variable that can be selected for log attributes.",
      "--label=<KEY>=<VALUE>: Set a container label that can be selected for log attributes.",
      "Prerequisite: Docker Engine 29.5.0 or later; this support was included in the 29.5.0 release.",
      "Docs conflict: The release note names `label` and `label-regex`; the merged PR's runnable example and official Docker logging option documentation use `labels` and `labels-regex`. Use the documented plural spellings."
    ]
  },
  "why_it_matters": "Configure a container to use the local logging driver with custom log attributes.",
  "sources": [
    "https://github.com/moby/moby/releases/tag/docker-v29.5.0",
    "https://github.com/moby/moby/pull/52348",
    "https://docs.docker.com/engine/logging/drivers/local/"
  ],
  "rank": 0.90025,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1b-tools-20261017",
    "verdict_id": "wave1b-tools-20261017:wave1b-tools-20261017-f70f7fec5258f63c-2:gate",
    "evidence_hash": "83eca4a74c926923a603022561c4717ee39982c9e3dd0b2ab1c1144aaacc06fb"
  },
  "review": {
    "draft_hash": "fe67be3d1663cb1666fafe43dce338229d46c5e64ab0ecc05956e830ca430d5a",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-tools-20261017:gate",
    "reason": "2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.90 >= 0.9; 2 needed) and Jev gave 0.65 (>= 0.6 needed)."
  }
}
