·
13 commits
to main
since this release
Minor Changes
- 7d22709: Add the
logixlysia/axiomadapter.createAxiomTransport()ships logs to an Axiom dataset via the ingest API with batching, retries, and env-based credentials (AXIOM_API_KEY,AXIOM_DATASET,AXIOM_ORG_ID,AXIOM_URL). Events keep their nested structure so every field is queryable with APL. - 7d22709: Add the
logixlysia/better-stackadapter.createBetterStackTransport()ships logs to Better Stack Telemetry usingBETTER_STACK_SOURCE_TOKEN, supporting both the legacy shared endpoint and the dedicated per-source ingesting hosts (BETTER_STACK_INGESTING_HOST). Logs post with adttimestamp,level,message, and the full meta object. - 7d22709: Add the
logixlysia/clickhouseadapter.createClickHouseTransport()inserts logs into a ClickHouse table over the HTTP interface usingJSONEachRow— rows carrytimestamp,level,message, and anattributesmap of the flattened meta. Database and table names are validated as plain identifiers, and ISO timestamps parse viadate_time_input_format=best_effort. - 7d22709: Add the
logixlysia/datadogadapter.createDatadogTransport()ships logs to Datadog's v2 logs intake (DD_API_KEY,DD_SITEfor regions). The log level lands in thestatusattribute for Datadog's default remapper, the HTTP response status follows the standardhttp.status_codeattribute, and the full meta object rides along as searchable attributes. - f8f6960: Add
config.enrichersand thelogixlysia/enricherssubpath. An enricher contributes fields to the request context once and they reach every sink at once — console tree, file logs, and all transports. Four are built in:traceparentEnricher()parses the W3Ctraceparentheader directly, with no OpenTelemetry SDK required, so logs link to traces in Sentry, HyperDX, or any OTLP backend;userAgentEnricher()adds browser, OS, device, and bot fields;geoEnricher()reads the geo headers Vercel, Cloudflare, and Netlify already attach;sizeEnricher()recordsrequestBytesandresponseBytes. Custom enrichers are a bare function (request phase) or an object withrequestandresponsephases. A hook that throws is reported viaonErrorwith the newsink: 'enricher'and skipped, never failing the request. - 7d22709: Add the
logixlysia/hyperdxadapter.createHyperDXTransport()ships logs to HyperDX (cloud or self-hosted collectors) as OTLP JSON over HTTP, authenticated withHYPERDX_API_KEY. Meta fields become dot-notation log attributes searchable in the HyperDX UI. - 7d22709: Add the
logixlysia/lokiadapter.createLokiTransport()pushes logs to Grafana Loki (self-hosted or Grafana Cloud with basic auth, multi-tenant viaX-Scope-OrgID). Streams are labeled with low-cardinalityservice_nameandlevel; the log line is the message and full meta as JSON, ready for LogQL's| json. - 7d22709: Add the
logixlysia/otlpadapter.createOtlpTransport()ships logs to any OTLP/HTTP logs endpoint asExportLogsServiceRequestJSON — OpenTelemetry Collectors, Grafana Cloud, New Relic, Honeycomb, SigNoz, and other OTLP-compatible backends. Honors the standardOTEL_EXPORTER_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_HEADERS, andOTEL_SERVICE_NAMEvariables. - 7d22709: Add the
logixlysia/posthogadapter.createPostHogTransport()captures logs as PostHog events via the batch API (POSTHOG_API_KEY,POSTHOG_HOSTfor EU/self-hosted). Meta fields become dot-notation event properties, and logs carrying auserIdin the request context are linked to PostHog persons viadistinct_id. - f8f6960: Add head + tail sampling via
config.sampling. Head sampling keeps a percentage of records per level ({ INFO: 10 }; levels left out keep everything), so log spend stops scaling one-for-one with traffic. Tail sampling buffers what head dropped and replays it when the finished request matchesstatus,durationMs, or a path glob — failures and slow paths keep their full log trail instead of losing nine lines in ten. Dropped records skip context merging, redaction, formatting, and every sink; replayed ones keep the duration they had when captured. - 7d22709: Add the
logixlysia/sentryadapter.createSentryTransport()ships structured logs to Sentry (Explore > Logs) via the envelope endpoint usingSENTRY_DSN— no Sentry SDK required. Every meta field becomes a typed, searchable attribute, andtrace_idfrom the request context links logs to traces. - f8f6960:
HttpErrornow carries the context that makes a failure actionable:code(a stable identifier the client can branch on, unlike the message),why,fix,link, andinternal. The first four appear in both the log and the response body;internalis log-only — it is non-enumerable and excluded fromtoJSON(), so no serializer can put it in a response. Error details also render in the console context tree for 4xx responses now, not just 5xx. Fully backward compatible:new HttpError(404, 'Not found')still responds with the bare message, and only an error carrying at least one client-facing field responds as JSON. - f8f6960: The request-scoped logger is now generic over your field type:
logixlysia<CheckoutFields>()typeslog.mergeContext()and the per-callcontextargument asPartial<CheckoutFields>, so TypeScript rejects a misspelleduser_idbefore it splits your dashboard query in two.useLogger<CheckoutFields>()takes the same parameter for code outside the handler. Type-only with no runtime cost, and the default keeps every key allowed, so existing untyped code is unaffected.