Repository navigation
Log only safe fields of axios errors - #562
Draft
Ferrum-Citadel wants to merge 1 commit into
Draft
Ferrum-Citadel wants to merge 1 commit into
Ferrum-Citadel wants to merge 1 commit into
Conversation
Ferrum-Citadel
force-pushed
the
fix/log-axios-errors-safely
branch
from
November 12, 2026 09:30
f306424 to
f0fd55e
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFGeS5cho3JHRATAcd4847
Ferrum-Citadel
force-pushed
the
fix/log-axios-errors-safely
branch
from
November 12, 2026 09:36
f0fd55e to
011988d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
An axios error holds the request config and the raw request. When an app logs one, orka writes the whole error to the JSON logs and to the Honeybadger context. This includes the
Authorizationheader,auth, the request body and the query string.Fix
For axios errors, both appenders log only these fields:
name,message,code,status.config.method,config.baseURL,config.url, without the query string.response.status,response.statusText,response.data, if it is not a stream or a buffer.Both appenders do this at any depth in the context.
Impact
Apps that log axios errors with
LOG_JSON=trueor Honeybadger. The kept fields keep their paths. Other fields, for exampleresponse.headers, are not logged now. Other logs do not change.Tests
TEST_KAFKA=true npm test: 317 passing, 10 pending.The pre-commit hook reformatted two old blocks in
json-appender.test.ts.🤖 Generated with Claude Code
https://claude.ai/code/session_01KFGeS5cho3JHRATAcd4847