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#

VariableExampleEffect
LOGIT_LEVELdebugthe minimum level of any logger created without an explicit minimumLevel. Any spelling parseLevel accepts. An unreadable value is ignored, with a selfLog note
LOGIT_OVERRIDESnext=warn,app.db=verboseper-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#

VariableEffect
NO_COLORset to anything non-empty: no ANSI colour, ever
FORCE_COLORset to anything but 0: colour even when stdout is not a terminal
TERM=dumbno 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():

VariableEffect
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTthe full URL for logs
OTEL_EXPORTER_OTLP_ENDPOINTthe base URL; /v1/logs is appended
OTEL_EXPORTER_OTLP_LOGS_HEADERS, OTEL_EXPORTER_OTLP_HEADERSkey=value,key2=value2, URL-decoded
OTEL_SERVICE_NAMEservice.name in the resource, under the resource option

Node#

VariableEffect
NODE_ENVwithEnvironment() and withProcessInfo() write it as Environment

Next.js#

VariableEffect
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 friendsnothing in the package reads them; the request adapters read the x-vercel-id header