Observability

Logs

This feature is in Early Access

LaunchDarkly’s observability features are publicly available in early access.

They currently require the LaunchDarkly observability plugins and the JavaScript SDK. If you are interested participating in the Early Access Program for our upcoming observability plugins for server-side SDKs, sign up here.

Overview

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

A view of the Logs page, with a specific log highlighted.

A view of the Logs page, with a specific log highlighted.

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

A detailed view of a log entry.

A detailed view of a log entry.

Get started

To instrument your application to capture logs, read the SDK documentation on Observability. The functionality is available through plugins to the LaunchDarkly JavaScript SDK.

To learn more about the search specification for the logs view, read Search specification.

Search attributes

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

AttributeDescriptionExample
code.filepathFile path emitting the log./build/backend/worker/worker.go
code.functionFunction emitting the log.github.com/acme-org/acme/backend/worker.(*Worker).Start.func3
code.linenoLine number of the file where the log was emitted.20
environmentThe environment key, based on the SDK credentials used in the SDK plugin.production
host.nameThe hostname.ip-172-31-5-211.us-east-2.compute.internal
levelThe log level.info
messageThe log message.public-graph graphql request failed
os.descriptionDescription of the operation system.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)
os.typeType of operating system.linux
secure_session_idSession ID that contains the log.wh1jcuN5F9G6Ra5CKeCjdIk6Rbyd
service_nameName of the service specified in the SDK plugin. To learn more, read Versioning sessions and errors.private-graph
service_versionVersion of the service specified in the observability SDK plugin. To learn more, read Versioning sessions and errors.e1845285cb360410aee05c61dd0cc57f85afe6da
sourceGeneral origin of the log.backend
span_idSpan ID that contains this log.528a54addf6f91cc
trace_idTrace ID that contains this log.7654ff38c4631d5a51b26f7e637eea3c