Logging exporter (deprecated)

Use the logging exporter to write traces, metrics, and logs to the console. Read on to learn how to configure the component.

CAUTION: The logging exporter is deprecated. Use the debug exporter instead.

The logging exporter allows the OpenTelemetry Collector to send traces, metrics, and logs directly to the console. The supported pipeline types are traces, metrics, and logs.

Use the logging exporter to diagnose and troubleshoot issues with telemetry received and processed by the OpenTelemetry Collector, or to obtain samples for other purposes.

Configure the exporter

Note: The logging exporter sends pipeline activity to the console as logs. To control the verbosity of the OpenTelemetry Collector itself, use the service.logger setting.

By default, the Splunk Distribution of OpenTelemetry Collector includes the logging exporter with verbosity set to detailed when deploying in host monitoring (agent) mode. See Collector deployment modes for more information.

  1. Add logging to the exporters section of your OpenTelemetry Collector configuration file.

    Sample configuration

    The following example shows a logging exporter with basic verbosity, initial sampling of 5 messages logged each second, and logging every 200 messages after the initial sample.

    YAML
    exporters:
      logging:
        # loglevel is deprecated; use verbosity instead
        verbosity: basic
        sampling_initial: 5
        sampling_thereafter: 200
  2. Configure advanced settings.

  3. Add the logging exporter to any pipeline you want to diagnose. For example:

    YAML
    service:
      pipelines:
        traces:
          receivers: [jaeger, otlp, zipkin]
          processors:
          - memory_limiter
          - batch
          - resourcedetection
          exporters: [otlphttp, signalfx, logging]
        metrics:
          receivers: [hostmetrics, otlp, signalfx]
          processors: [memory_limiter, batch, resourcedetection]
          exporters: [signalfx, logging]
        logs:
          receivers: [fluentforward, otlp]
          processors:
          - memory_limiter
          - batch
          - resourcedetection
          exporters: [splunk_hec, logging]

Review collected logs

To review logs produced by the logging exporter, run the following command:

BASH
journalctl -u splunk-otel-collector.service -f

Settings

Valid values for verbosity are basic, normal, and detailed.

Warning: The detailed verbosity level might increase resource consumption on the host. Deactivate the logging exporter after you’ve obtained sufficient samples.

The following table explains the correspondence between verbosity and the deprecated parameter loglevel:

verbosity

loglevel (deprecated)

basic

warn, error, panic, fatal

normal

info

detailed

debug

included

https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/exporter/logging.yaml

Troubleshooting

See Troubleshoot the Splunk OpenTelemetry Collector.