Reference
Environment variables
LOGIT_LEVEL, LOGIT_OVERRIDES, colour, OpenTelemetry and Next.js runtime variables.
Read through process.env, when it exists; in a browser none of these apply.
logit's own#
| Variable | Example | Effect |
|---|---|---|
LOGIT_LEVEL | debug | the minimum level of any logger created without an explicit minimumLevel. Any spelling parseLevel accepts. An unreadable value is ignored, with a selfLog note |
LOGIT_OVERRIDES | next=warn,app.db=verbose | per-source minimums, merged under the configured overrides (explicit keys win). Unreadable entries are skipped |
Both are read when a logger is created or configure() is called — not continuously. Restart, or use a LevelSwitch, to change a running process.
Colour#
| Variable | Effect |
|---|---|
NO_COLOR | set to anything non-empty: no ANSI colour, ever |
FORCE_COLOR | set to anything but 0: colour even when stdout is not a terminal |
TERM=dumb | no colour |
Without these the console sink colours when its stream is a TTY. The same rule chooses the default format: pretty when colours are on or stdout is a TTY, JSON otherwise.
OpenTelemetry#
Read by otlpHttpSink():
| Variable | Effect |
|---|---|
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | the full URL for logs |
OTEL_EXPORTER_OTLP_ENDPOINT | the base URL; /v1/logs is appended |
OTEL_EXPORTER_OTLP_LOGS_HEADERS, OTEL_EXPORTER_OTLP_HEADERS | key=value,key2=value2, URL-decoded |
OTEL_SERVICE_NAME | service.name in the resource, under the resource option |
Node#
| Variable | Effect |
|---|---|
NODE_ENV | withEnvironment() and withProcessInfo() write it as Environment |
Next.js#
| Variable | Effect |
|---|---|
NEXT_RUNTIME | 'nodejs' or 'edge', set by Next. Check it literally in instrumentation.ts to run Node-only configuration in the Node runtime — see Next.js |
VERCEL_URL and friends | nothing in the package reads them; the request adapters read the x-vercel-id header |