Skip to main content
Install the LogBrew SDK package for your runtime. The SDK formats events and delivers them. The package guide lists its event types, limits, and retry behavior. Run npx logbrew-cli@latest setup in the directory of your app. It does these steps for you. See Set up with one command. To do them yourself, do these steps for each integration:
  1. Install the SDK package for your runtime.
  2. Keep the project-scoped ingest key outside source control.
  3. Set stable service, environment, and release values.
  4. Send one safe test event from the application.
  5. Read the delivery result. Then find the event in LogBrew.
An accepted batch reached the LogBrew API. Filters can still hide its events. Select the correct project and time range. Then match the service, environment, release, and signal type. The inbound filters of the project can also drop events before LogBrew stores them. See Projects and setup. Before you enable capture, select and test approved fields. To populate Analytics, follow Product event capture.

Signals and shared context

The first five cards are signals. Release and environment are context for those signals. They are not a separate event type.

log

A structured message with severity, source, time, and safe context.

trace_span

One timed operation, linked to its trace by trace and span IDs.

issue

A captured failure, its severity, and the error details that the app sent.

action

An action in your app, with optional subject, session, and safe properties.

metric

One numeric measurement with a name, kind, value, unit, and temporality.

release and environment

The code version and environment attached to later events in the same SDK scope.

Severity values

Use info, warning, error, or critical for logs and issues. SDKs and runtimes can send aliases such as trace, debug, warn, or fatal. LogBrew normalizes accepted aliases to the canonical values.

Package-manager installs

Install the SDK package for the runtime that sends telemetry. Use project-scoped SDK or ingest configuration from LogBrew. Do not use account login values as SDK configuration. After you install the SDK, send one test event and read it back. See Verify your setup. If you use OpenTelemetry, you can send OTLP data without a LogBrew SDK. Follow Send OpenTelemetry data. For a Supabase project, follow Supabase.

Node.js request tracing

For request-root trace correlation, use @logbrew/sdk 0.1.16 or newer and @logbrew/node 0.1.11 or newer. Express requires @logbrew/express 0.1.5 or newer. Fastify and NestJS require their LogBrew package at 0.1.6 or newer. These integrations create or continue one request span. The span name uses the matched route template. Logs, issues, actions, and metrics inside the request inherit its trace and span context. A newer package does not add context to events that were sent before the upgrade. With @logbrew/express 0.1.12 or newer, the template includes the mount path of the router, such as GET /tenants/:tenantId/orders/:orderId. A mount path that is a regular expression keeps only the route of the handler. withLogBrewHttpHandler from @logbrew/node 0.1.27 or newer changes each numeric, UUID, or long hexadecimal path segment to :id. For example, GET /orders/8412 becomes GET /orders/:id. To name requests yourself, set routeTemplateFactory(req). When it returns an empty string, the SDK uses the next name source. The default request integration does not capture request or response bodies, query strings, arbitrary headers, or raw traceparent values.

Service name

The service name groups traces, logs, and issues. Set LOGBREW_SERVICE_NAME to select it. Without it, the Node.js, Express, Fastify, NestJS, and Next.js SDKs use the name in the nearest package.json of the app. Next.js reads that file on the Node.js runtime only. Edge and browser code cannot read it, so set LOGBREW_SERVICE_NAME there or give the service in context. To stop the package.json lookup, set captureRuntimeContext: false. This needs @logbrew/node 0.1.24 or newer and @logbrew/next 0.1.13 or newer. An event without a service shows as unknown_service. This is the OpenTelemetry name for a missing service. LogBrew does not use the SDK name, such as logbrew-express, as the service.

Client errors

An error with a 4xx status or statusCode is not an issue in Express, Fastify, NestJS, or withLogBrewHttpHandler. Examples are a thrown 404 or a 400 from input validation. These errors describe the request, not a failure in your app. The request span keeps the 4xx status, so the request stays in traces. withLogBrewHttpHandler also sends that 4xx status instead of 500. To report these errors as issues, set captureClientErrors: true. Fastify needs @logbrew/fastify 0.1.10 or newer, NestJS needs @logbrew/nestjs 0.1.11 or newer, and withLogBrewHttpHandler needs @logbrew/node 0.1.24 or newer. In a Next.js Route Handler that withLogBrewRouteHandler wraps, notFound(), forbidden(), unauthorized(), redirect(), and permanentRedirect() are not issues. LogBrew records the request with the 404, 403, 401, 307, or 308 status that Next.js sends. It does not record the redirect destination. Other thrown errors stay issues, also with a 4xx status, because Next.js answers them with a 500. captureClientErrors: true reports notFound(), forbidden(), and unauthorized() as issues. It does not change redirects. Use @logbrew/next 0.1.14 or newer.

Next.js page views and Web Vitals

useLogBrewNextNavigation from @logbrew/next/client records one route span when the route of the page changes. LogBrew counts each of these spans as a page view of its route template. The hook accepts traceparent, traceId, or traceId with spanId. It never throws into the page. When a capture fails, it drops the span and calls onCaptureError. React Router apps get the same behavior from useLogBrewReactRouterNavigation in @logbrew/react 0.1.4 or newer. installLogBrewNextClientErrorCapture sends the Web Vitals of the page as histogram metrics when the page is first hidden. browser.web_vital.lcp, browser.web_vital.inp, browser.web_vital.fcp, and browser.web_vital.ttfb are in milliseconds. browser.web_vital.cls is a score. Each metric has metadata.rating (good, needs-improvement, or poor) and metadata.routeTemplate, the route that the page loaded on. To stop these metrics, set webVitals: false. Page views and Web Vitals need @logbrew/next 0.1.17 or newer.

Delivery after a rejected batch

An SDK pauses automatic delivery after LogBrew rejects a batch, for example with a 401 or 403 response. These SDKs then send the same batch again on their own: The SDK waits longer after each failed try, up to 5 minutes. The first accepted try starts normal delivery again. You do not have to restart the app. The queue limits do not change.

ASP.NET Core

CLI v0.1.55 or newer detects .NET 10 projects that use Microsoft.NET.Sdk.Web. Preview the setup plan from the project root. This command does not change your files:
The released plan installs the host integration:
Set LOGBREW_SERVER_API_KEY, LOGBREW_SERVICE_NAME, LOGBREW_ENVIRONMENT, and LOGBREW_RELEASE outside source control. Register LogBrew with the host and place its middleware after routing:
Without LOGBREW_SERVER_API_KEY, both registration calls are safe no-ops. The ASP.NET Core NuGet package identifies the released host integration. Its public package guide covers host lifecycle, request capture, issue capture, privacy limits, and recovery.

Java with Maven or Gradle

CLI v0.1.54 or newer detects pom.xml, build.gradle, and build.gradle.kts. Preview the setup plan from the project root. This command does not change your files:
For Maven, add the released package:
For Gradle Kotlin DSL, add the same Maven Central artifact:
Use Java 11 or newer. Spring Boot 3 and 4 applications can expose an app-owned LogBrewClient bean. It enables optional request, exception, HTTP client, JDBC, and cache integrations. Spring Kafka capture is explicitly opt in with logbrew.kafka.enabled=true. It uses the application’s existing Spring Kafka dependency and client bean. The Java SDK artifact on Maven Central identifies the released package. Its public guide covers bounded HTTP delivery, shutdown, logging, Spring configuration, Kafka correlation, and privacy limits.

C++ with CMake

The C++ SDK requires C++17 and CMake 3.16 or newer. CLI v0.1.39 or newer detects a root CMakeLists.txt. Run logbrew setup --json to preview this setup plan without changing your files:
The core target is dependency-free. To send batches through the optional libcurl transport, replace the final FetchContent_MakeAvailable call and target link above with:
Configure the application. Then build it to test the selected SDK version:
For builds that cannot fetch the SDK monorepo, use the scoped logbrew-cpp-0.2.3.tar.gz asset from the C++ 0.2.3 release. The extracted package supports cmake --install and find_package(LogBrew 0.2.3 CONFIG REQUIRED). Its package guide covers typed context, issue evidence, span events, metrics, actions, and HTTP delivery.

Go

The Go SDK and its Asynq, Gin, and OpenTelemetry modules require Go 1.26.0 or newer. LogBrew supports only the Go releases that still get security fixes, currently Go 1.26 and 1.27.

Rust

The logbrew crate needs Rust 1.88 or newer.

JavaScript source maps

For Vite builds, follow JavaScript source maps. It covers the plugin, artifact key, upload checks, and a new issue with original source locations.

Apple, Flask, and React Native

Use the LogBrew Swift product for telemetry. Add LogBrewCrash only for Apple crash or hang capture. Follow Capture Apple crashes and hangs for dSYM upload and hosted symbolication. LogBrew Swift 0.1.26 or newer sends one app.start.duration histogram metric for each cold launch. The value is the time in milliseconds from the process start to the first frame, or to client.markAppReady() when the app calls it first. To stop this metric, set includeAppStartMetric: false. For Flask, follow Set up Flask. For React Native and Expo, follow React Native. It covers the project key, a safe test log, delivery errors, and the Expo Metro configuration for production source maps.

JavaScript queue tracing

Node queue integrations are separate npm packages. Install the base LogBrew JavaScript packages, the integration package, and the queue or broker client your app already uses. Use these packages for explicit, app-owned trace correlation around the queue calls you select. LogBrew does not own your broker connection, create queues, or globally patch every client by default.
Keep queue payloads, arbitrary message headers, broker URLs, and session or account bearer values out of SDK configuration. Use project-scoped server ingest configuration from LogBrew.

Direct native envelope

Use POST /api/telemetry/ingest only for a custom client that no public LogBrew SDK supports. Public SDKs use their own batch format. This endpoint does not accept that format. Send 1 to 512 items in one native envelope. All items in one envelope share the project, service, release, environment, and optional trace context.

Item fields

Each item has a type and a data object. A log item uses level. An issue item uses severity. Both accept the values in Severity values. Send an id with each item when your client can retry. When a retry sends an accepted item again with the same id and content, LogBrew does not store it again. The response counts that item in already_accepted.

Issue item fields

An issue item reports one occurrence of an error. LogBrew groups matching occurrences into one issue. A stack frame accepts module, function, filename, line, column, in_app, and debug_id. All frame fields are optional. Set in_app to true for frames from your own code. debug_id is a UUID that identifies the release artifact for symbolication. Without fingerprint, LogBrew groups by exception_type, or by title when exception_type is missing. It also uses the module, function, and filename of the first 8 frames. Without frames, it uses title and message. Line and column numbers do not change the group.

Example request

The example sends one issue item, one log item, and one action item. Save the JSON below as telemetry-envelope.json. Replace the example project ID with the exact project ID for your ingest key. Set the timestamps to the test event’s current UTC time. Use your own service and release values.
telemetry-envelope.json
Load the project-scoped ingest value into LOGBREW_INGEST_BEARER through your protected configuration. Do not print it or use an account credential. The following command sends the file once. It requires curl 7.76.0 or newer:
Read the HTTP status and body. --fail-with-body preserves an error body and returns a nonzero exit status for HTTP errors. A network failure or timeout does not tell you whether LogBrew accepted the request. Send the same file again only when its items have id values. Without id values, a second send can store the items two times.

Response

A successful request returns 200 with counts of the new items by stream. already_accepted counts items that an earlier request already delivered.

Errors

An invalid or revoked ingest key returns 401. A key for a different project also returns 401:
Use a project-scoped ingest key. Do not replace it with an account credential. An artifact key cannot send telemetry. An envelope that breaks a field rule returns 422 with code validation_failed. The error field names the rule. The next field tells you how to fix the request. For example, "items": [] returns:
Do not send an envelope when there are no events. An envelope with more than 512 items returns 422 with the error native telemetry envelope exceeds the item limit. Split it into batches of 512 or fewer items. Keep the project and shared context in each batch. For usage limits, rate limits, and service failures, follow the returned code in API errors.
Set release and environment in SDK setup. Create or continue trace context for each operation. Do not reuse one trace ID for unrelated work.