title: Single log line
body: <p>As a developer, I want a single log line with <a href="https://opentelemetry.io/docs/concepts/signals/logs/" rel="nofollow noreferrer">OpenTelemetry Logs</a>.  Using the following example I am able to use Otel <code>_logs</code>, but they are emitted on several lines, which makes correlating difficult.</p>
  <p>common.py</p>
  <pre><code>import logging
  
  from opentelemetry.sdk._logs import (
      LogEmitterProvider,
      LoggingHandler,
      set_log_emitter_provider,
  )
  from opentelemetry.sdk._logs.export import BatchLogProcessor, ConsoleLogExporter
  from opentelemetry.sdk.resources import Resource
  from opentelemetry.semconv.resource import ResourceAttributes
  
  from local_machine_resource_detector import LocalMachineResourceDetector
  
  
  def configure_logger(name, version):
      local_resource = LocalMachineResourceDetector().detect()
      resource = local_resource.merge(
          Resource.create(
              {
                  ResourceAttributes.SERVICE_NAME: name,
                  ResourceAttributes.SERVICE_VERSION: version,
              }
          )
      )
      provider = LogEmitterProvider(resource=resource)
      set_log_emitter_provider(provider)
      exporter = ConsoleLogExporter()
      provider.add_log_processor(BatchLogProcessor(exporter))
      logger = logging.getLogger(name)
      logger.setLevel(logging.DEBUG)
      handler = LoggingHandler()
      logger.addHandler(handler)
      return logger
  </code></pre>
  <p>common_runner.py</p>
  <pre><code>from common import configure_logger
  
  logger = configure_logger(&quot;common_runner&quot;, &quot;6.6.6&quot;)
  
  logger.debug(
      &quot;common_runner.py module has been run&quot;,
      extra={
          &quot;username&quot;: &quot;Sid Vicous&quot;,
      },
  )
  </code></pre>
  <p>Here's the output:</p>
  <pre><code>{
      &quot;body&quot;: &quot;common_runner.py module has been run&quot;,
      &quot;severity_number&quot;: &quot;&lt;SeverityNumber.DEBUG: 5&gt;&quot;,
      &quot;severity_text&quot;: &quot;DEBUG&quot;,
      &quot;attributes&quot;: {
          &quot;username&quot;: &quot;Sid Vicous&quot;
      },
      &quot;timestamp&quot;: &quot;2022-07-13T14:40:08.595698Z&quot;,
      &quot;trace_id&quot;: &quot;0x00000000000000000000000000000000&quot;,
      &quot;span_id&quot;: &quot;0x0000000000000000&quot;,
      &quot;trace_flags&quot;: 0,
      &quot;resource&quot;: &quot;BoundedAttributes({'telemetry.sdk.language': 'python', 'telemetry.sdk.name': 'opentelemetry', 'telemetry.sdk.version': '1.11.1', 'net.host.name': 'Doug.Ramirez', 'net.host.ip': '127.0.0.1', 'service.name': 'common_runner', 'service.version': '6.6.6'}, maxlen=None)&quot;
  }
  </code></pre>
  <p>Here's what I would like to see in my APM platform (Datadog):</p>
  <pre><code>{&quot;body&quot;: &quot;common_runner.py module has been run&quot;, &quot;severity_number&quot;: &quot;&lt;SeverityNumber.DEBUG: 5&gt;&quot;, &quot;severity_text&quot;: &quot;DEBUG&quot;, &quot;attributes&quot;: {&quot;username&quot;: &quot;Sid Vicous&quot;}, &quot;timestamp&quot;: &quot;2022-07-13T14:40:08.595698Z&quot;,    &quot;trace_id&quot;: &quot;0x00000000000000000000000000000000&quot;, &quot;span_id&quot;: &quot;0x0000000000000000&quot;, &quot;trace_flags&quot;: 0,    &quot;resource&quot;: &quot;BoundedAttributes({'telemetry.sdk.language': 'python', 'telemetry.sdk.name': 'opentelemetry', 'telemetry.sdk.version': '1.11.1', 'net.host.name': 'Doug.Ramirez', 'net.host.ip': '127.0.0.1', 'service.name': 'common_runner', 'service.version': '6.6.6'}, maxlen=None)&quot;}
  </code></pre>