apache/beam

[Feature Request]: Add a native Logging transform to Java SDK

Open

#38528 opened on May 18, 2026

View on GitHub
 (3 comments) (0 reactions) (1 assignee)Java (7,313 stars) (4,097 forks)batch import
P2good first issuejavanew feature

Description

What would you like to happen?

AFAIK the Java SDK doesn't have an easy utility to print/log the outputs of a PCollection. I've always had to hack something together like:

    rows.apply(MapElements.into(strings()).via(row -> {
      System.out.println("row: " + row);
      return "";
    }));

Would be nice to have an easy utility that can be used like:

    rows.apply(Log.info());

The Python SDK has something like this: https://github.com/apache/beam/blob/26c6ec7cb749d60455c9895aa1be49d5cf552a75/sdks/python/apache_beam/transforms/util.py#L2183-L2197

Issue Priority

Priority: 2 (default / most feature requests should be filed as P2)

Issue Components

  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Infrastructure
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Prism Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner

Contributor guide