Changelog - 2026-08-12
Log Arguments Under %j No Longer Collapse to [Circular]
Bug Fix Security Behavior ChangeIn one line. A %j log argument that carries a transaction, a connector or a request context now prints its real fields instead of the single token [Circular].
What changed
- Cycles collapse per branch. Only the offending reference prints
"[Circular]"; every sibling field survives. - Secret-looking keys are redacted under
%j, as they already were under%s. Passwords and tokens in a%jpayload previously reached the log in clear. - The walk is depth-capped by
APP_ENV_LOGGER_INSPECT_DEPTH(default5). Below the cap a value prints"[Object]". - An
Errorunder%jkeeps itsmessageandstack. It used to render as{}. - A
Dateno longer flattens to{}under%s.
text
Args: [{"id":"user-1","data":{"username":"phatnt","password":"[REDACTED]"},"transaction":
{"connector":{"query":{"users":"[Object]"},"session":{"dialect":"[Circular]","client":
"[Object]"}},"isActive":true}}]Who is affected
- Anyone logging with
%j. No action needed. Lines that printed[Circular]now print data, and deep payloads truncate at depth 5. - Anyone parsing log lines downstream. A
%jfield can now hold"[Circular]","[Object]","[Array]"or"[Binary N bytes]"as a string value. - Anyone logging an
Errorwith%j. The line grows: it now carriesmessage,stackand every enumerable own property. Use%sfor errors - only%sroutes throughErrorPrettier.
Details
%o,%Oand arguments with no placeholder are still handed toutil.formatuntouched, so they are not redacted. Bind anything that may carry a credential to%sor%j.- A payload holding a live handle still prints noise. Keep transactions and request contexts out of the logged arguments.
toJsonSafeis exported for the same projection outside the logger:
typescript
import { toJsonSafe } from '@venizia/ignis-helpers';
const safe = toJsonSafe({ value: payload, depth: 5 });