Replace raw `console.log` and unstructured `Logger.log` string interpolation with structured, redacted logging
@ravimahatonp is already working on this.
Since Oct 9, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- aws, nodejs, typescript
- Domain
- observability, security
Research direction
Start in src/logging/, which holds the logger the redaction wrapper would sit in, then read the object-payload example in cache-warming.service.ts around lines 59-62 as the style to match. Find the interpolated call in src/blockchain/oracle/services/submitter.service.ts around lines 243-244 and the console.* call in database-index.service.ts near line 117. Done means a test asserting that password, privateKey and token keys are masked, no console.* outside specs, and the policy written in CONTRIBUTING.md. Check with the maintainers first, since the issue asks to coordinate with the logging-facade issue.
Written by the indexing model from the issue text.
Description
Problem
Logging is not consistently structured, and there is no evidence of a redaction policy. Two concrete issues:
- Six raw
console.*calls remain insrc/— one is insrc/common/database/database-index.service.ts:117, which logs index names immediately after building SQL from interpolated identifiers. - Controllers use string interpolation, e.g.
src/blockchain/oracle/services/submitter.service.ts:243-244:
while services use structured object payloads (e.g.this.logger.log( `Submitting payload ${payloadId} with gas limit ${gasLimit} (attempt ${attempt})`, );cache-warming.service.ts:59-62). Interpolated strings cannot be filtered by field in CloudWatch, so an operator cannot querypayloadId=Xwithout a full-text grep.
The risk is what gets interpolated. The codebase handles credentials, tokens, wallet signatures, API keys (.env.secrets.template), and wallet private keys — and the README instructs operators to "store signing keys in a KMS" (line 243). Any of those reaching a log line is a disclosure, and logs are commonly shipped to third parties (CloudWatch is configured in package.json).
Why it matters
This is a real and common source of credential leakage. The relevant question for each log site is what values it interpolates — and today that is not answerable by inspection, because there is no convention and no redaction layer.
Note the related issue on plaintext refresh tokens: an adjacent leak path. Fixing one and not the other leaves the same risk open.
Suggested Direction
- Adopt one structured call style, matching what already exists:
Object payload plus a static message. Never interpolate values into the message string.this.logger.log({ payloadId, gasLimit: gasLimit.toString(), attempt }, 'Submitting payload'); - Add a redaction layer at the logger, not per call site. A wrapper that walks the payload and masks keys matching a denylist —
password,token,secret,privateKey,authorization,signature,mnemonic,seed— is far more reliable than relying on every developer to remember.src/logging/(14 files) is the natural home. - Audit the existing call sites for values that should never be logged, starting with the auth and oracle paths.
- Replace the six
console.*calls with the configured logger. - Document the redaction policy in
CONTRIBUTING.mdso new call sites follow it.
Constraints
- Never log secret values, even temporarily — including in error paths. Check
catchblocks carefully, since they are the most likely place to dump a whole object. - Preserve log levels; do not demote an
errortologto reduce noise. - Redaction must not break structured querying — mask values, keep keys, so an operator can still filter on which key appeared.
- Coordinate with the logging-facade issue so redaction lands in the single chosen implementation.
Acceptance Criteria
- A redaction layer masks configured sensitive keys in all log payloads.
- No log call interpolates a value into the message string.
- No
console.*calls remain outside spec files. - A test asserts that a payload containing
password/privateKey/tokenis masked. - The auth and oracle log sites are audited, with findings recorded.
- The policy is documented in
CONTRIBUTING.md.
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 55
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 5
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SourceXXL/alian_structure-api
-
good first issue help wanted security
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SourceXXL/alian_structure-api#266 ·
-
Parallelize the cache-warming loop in `cache-warming.service.ts` — warmers run strictly sequentiallyPossibly taken @syntaxsuuvam-spec claimed this 3 days ago. Opengood first issue performance
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SourceXXL/alian_structure-api#240 ·
-
documentation help wanted intermediate refactor
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
SourceXXL/alian_structure-api#215 ·
-
good first issue refactor tooling
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
SourceXXL/alian_structure-api#199 ·
-
help wanted intermediate refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SourceXXL/alian_structure-api#196 ·
All issues in SourceXXL/alian_structure-api
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
homarr-labs/homarr#7191 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AvaProtocol/ava-sdk-js#276 ·
Maintainers usually reply within 1 day
-
useFragment does not require `variables` when the fragment's variables type has required fieldsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apollographql/apollo-client#13493 ·
Maintainers usually reply within 1 day