> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Logs

**Developer**

**Federal docs**

**EU docs**

This topic explains how to use LaunchDarkly observability features to open or review session logs. The **Logs** page displays a list of logs for your application. You can use the page to open or review the logs for a specific time range. Logs have different levels: `Debug`, `Info`, `Warn`, and `Error`.

![The Logs page with a query in the query builder.](https://mintcdn.com/launchdarkly/yk3Kp3OHEVZstPVO/images/__LD_UI_no_test/errors-logs.png?fit=max\&auto=format\&n=yk3Kp3OHEVZstPVO\&q=85\&s=c2e5d4ad06b2167c08cfb8d8bf1448e7)

The Logs page with a query in the query builder.

Click any log entry to read details about the event, such as the session ID, the source of the event, and more. Click **Related session** to review the session replay for the log entry.

![A detailed view of a log entry.](https://mintcdn.com/launchdarkly/YIC2H8XW-fomhquw/images/__LD_UI_no_test/errors-logs-details.png?fit=max\&auto=format\&n=YIC2H8XW-fomhquw\&q=85\&s=31fdae3e6e8722060fb7ecab132728b1)

A detailed view of a log entry.

## Get started

To instrument your application to capture logs, read the documentation on [Observability SDKs](https://launchdarkly.com/docs/sdk/observability). The functionality is available through plugins to the LaunchDarkly JavaScript SDK.

To view logs for your application, open the **Telemetry** section and navigate to the **Logs** list.

## Correlate logs with traces

When a log record arrives with trace context attached, LaunchDarkly records its `trace_id` and `span_id` so the log links to the trace and errors it belongs to.

If you send logs from services instrumented with Datadog, LaunchDarkly reads the Datadog trace context from each log and populates these fields for you. To learn more, read [Datadog Agent ingestion](https://launchdarkly.com/docs/home/observability/datadog-agent.md).

## Search

To search the **Logs** page, use the query builder. To learn more, read [Search specification](https://launchdarkly.com/docs/home/observability/search.md).

A search term without a key matches the log message. A quoted phrase matches the first and last words of the phrase as whole words. This means that `"recovered panic"` does not match the message `unrecovered panicky`. To learn more, read [Log message search](https://launchdarkly.com/docs/home/observability/search.md#log-message-search).

### Search attributes

By default, the observability SDK plugin automatically injects the following attributes to provide additional help with searching for logs:

<table>
  <thead>
    <tr>
      <th>Category</th>
      <th>Attribute</th>
      <th>Description</th>
      <th>Example</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Feature flag</td>
      <td>`feature_flag`</td>
      <td> Specifies whether the session is associated with a feature flag. You can refine results with the following additional attributes: `context.id`, `contextKeys`, `key`, `provider.name`, `result.reason.inExperiment`, `result.reason.kind`, `result.value`, and `set.id`.</td>
      <td>`true`</td>
    </tr>

    <tr>
      <td>Log properties</td>
      <td>`code.filepath`</td>
      <td>File path emitting the log.</td>
      <td>`/build/backend/worker/worker.go`</td>
    </tr>

    <tr>
      <td />

      <td>`code.function`</td>
      <td>Function emitting the log.</td>
      <td>`github.com/acme-org/acme/backend/worker.(*Worker).Start.func3`</td>
    </tr>

    <tr>
      <td />

      <td>`code.lineno`</td>
      <td>Line number of the file where the log was emitted.</td>
      <td>`20`</td>
    </tr>

    <tr>
      <td />

      <td>`level`</td>
      <td>The log level.</td>
      <td>`info`</td>
    </tr>

    <tr>
      <td />

      <td>`message`</td>
      <td>The log message.</td>
      <td>`public-graph graphql request failed`</td>
    </tr>

    <tr>
      <td />

      <td>`span_id`</td>
      <td>Span ID that contains this log.</td>
      <td>`528a54addf6f91cc`</td>
    </tr>

    <tr>
      <td />

      <td>`trace_id`</td>
      <td>Trace ID that contains this log.</td>
      <td>`7654ff38c4631d5a51b26f7e637eea3c`</td>
    </tr>

    <tr>
      <td>Service and application</td>
      <td>`environment`</td>
      <td>The environment key, based on the SDK credentials used in the [observability SDKs](https://launchdarkly.com/docs/sdk/observability).</td>
      <td>`production`</td>
    </tr>

    <tr>
      <td />

      <td>`host.name`</td>
      <td>The hostname.</td>
      <td>`ip-172-31-5-211.us-east-2.compute.internal`</td>
    </tr>

    <tr>
      <td />

      <td>`os.description`</td>
      <td>Description of the operating system.</td>
      <td>`Alpine Linux 3.17.2 (Linux ip-172-31-5-211.us-east-2.compute.internal 5.10.167-147.601.amzn2.aarch64 #1 SMP Tue Feb 14 21:50:23 UTC 2023 arch64)`</td>
    </tr>

    <tr>
      <td />

      <td>`os.type`</td>
      <td>Type of operating system.</td>
      <td>`linux`</td>
    </tr>

    <tr>
      <td />

      <td>`secure_session_id`</td>
      <td>Session ID that contains the log.</td>
      <td>`wh1jcuN5F9G6Ra5CKeCjdIk6Rbyd`</td>
    </tr>

    <tr>
      <td />

      <td>`service_name`</td>
      <td>Name of the service specified in the SDK plugin. To learn more, read [Versioning sessions and errors](https://launchdarkly.com/docs/sdk/features/observability-config-client-side.md#versioning-sessions-and-errors).</td>
      <td>`private-graph`</td>
    </tr>

    <tr>
      <td />

      <td>`service_version`</td>
      <td>Version of the service specified in the observability SDK plugin. To learn more, read [Versioning sessions and errors](https://launchdarkly.com/docs/sdk/features/observability-config-client-side.md#versioning-sessions-and-errors).</td>
      <td>`e1845285cb360410aee05c61dd0cc57f85afe6da`</td>
    </tr>

    <tr>
      <td />

      <td>`source`</td>
      <td>General origin of the log.</td>
      <td>`backend`</td>
    </tr>
  </tbody>
</table>
