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.
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
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.
-
Add
loggingto theexporterssection 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.
YAMLexporters: logging: # loglevel is deprecated; use verbosity instead verbosity: basic sampling_initial: 5 sampling_thereafter: 200
-
Configure advanced settings.
-
Add the logging exporter to any pipeline you want to diagnose. For example:
YAMLservice: 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:
journalctl -u splunk-otel-collector.service -f
Settings
Valid values for verbosity are basic, normal, and detailed.
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:
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
included
https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/exporter/logging.yaml