containers/podman

journald log driver: support --log-opt labels to promote container labels as structured journal fields

Open

#28.187 aperta il 3 mar 2026

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)Go (3107 fork)batch import
ContribfestGood First Issuekind/featuretriagedvolunteers-wanted

Metriche repository

Star
 (31.686 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Feature request description

Podman's journald log driver does not support --log-opt labels= (or the quadlet equivalent LogOpt=labels=). Docker's journald driver supports this option, causing it to promote the specified container label key/value pairs as structured fields directly into each journal entry. In Podman, passing labels via LogOpt= is silently ignored.

Suggest potential solution

When a container is started with --log-opt labels=<key1> (or the equivalent in a quadlet), the journald log driver should read the specified label keys from the container's label set and write their values as structured fields into each journal message sent to the journald socket, matching Docker's behavior.

Have you considered any alternatives?

  • LogOpt=tag= can write a custom value into SYSLOG_IDENTIFIER, but this overwrites the container's display name and only accepts a single value, making it unusable for grouping containers that belong to multiple logical groups simultaneously (see Additional context).
  • LogExtraFields= in the quadlet's [Service] block doesn't work in my case because the fields are only attached for system units (see systemd/systemd#29956).

Additional context

The motivating use case is grouping loosely coupled containers into observable "log groups" for unified filtering via journalctl, without tight runtime using Podman pods or systemd slices. A shared service may belong to multiple such groups simultaneously, requiring it to carry multiple label keys which is impossible with the single-value tag approach but trivially handled by label promotion since each label key becomes its own independent journal field.

Guida contributor