logixlysia@6.9.4
Patch Changes
- 83e771c:
autoRedactnow masks values insideHeaders,URL,URLSearchParams,Map, andSetobjects. Before, these passed through unchanged and serialized with their original values. Compound key names such asnewPassword,apiSecret,aws_secret_access_key,authToken, andX-CSRF-Tokennow count as sensitive. Every value of a repeated query parameter and every percent-encoded path segment is checked. - d6e5b08: Correct the
useAsyncLocalStoragedocumentation: the request-scopedlogis always available on the handler context. The option only makesuseLogger()return the current request’s logger from anywhere in the request. - e5acc3a: A request answered with Elysia’s
status()helper is now logged with the status the client received, not 200 or 500. This covers a returnedstatus(), a thrown one, and one returned frombeforeHandle. The message is the string body, or the status text when the body is not a string. A returnedResponsekeeps its own status overset.statusunless it is 200, as in Elysia. Requests that reach neitheronAfterHandlenoronErrornow get their log line instead of none. These are an authresolvethat returnsstatus(401)and an error that an app-wideonErrorregistered before the plugin answers. - a7ec6d2: Logging no longer fails a request. An error whose message is an object, such as
throw status(401, { error: 'unauthorized' })inonRequest, no longer turns the response into a 500, and a BigInt or circular value in request context no longer crashes requests that print{context}. The Axiom, Better Stack, Datadog and Loki adapters write BigInts as strings and circular references as"[Circular]"instead of dropping the whole batch. Context-tree keys and structured error fields are sanitized like values. Any other failure while building a log record is reported toonErrorwith the newsink: 'format'. - c197893: WebSocket logging tracks each connection by Elysia’s underlying socket (
ws.raw) instead of the wrapper Elysia creates for every event. Message and close lines report the time since the connection opened instead of about 0 ms, context merged withmergeContext(ws, …)in one event is still there in the next, and the connection’s state is released on close.wrapWsthrows aTypeErrorwhen its first argument is not the route path.