Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Replace raw `console.log` and unstructured `Logger.log` string interpolation with structured, redacted logging

Open
#281 1 comment 0 reactions 0 assignees View on GitHub

@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

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

help wanted intermediate refactor security

Problem

Logging is not consistently structured, and there is no evidence of a redaction policy. Two concrete issues:

  1. Six raw console.* calls remain in src/ — one is in src/common/database/database-index.service.ts:117, which logs index names immediately after building SQL from interpolated identifiers.
  2. Controllers use string interpolation, e.g. src/blockchain/oracle/services/submitter.service.ts:243-244:
    this.logger.log(
      `Submitting payload ${payloadId} with gas limit ${gasLimit} (attempt ${attempt})`,
    );
    
    while services use structured object payloads (e.g. cache-warming.service.ts:59-62). Interpolated strings cannot be filtered by field in CloudWatch, so an operator cannot query payloadId=X without 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

  1. Adopt one structured call style, matching what already exists:
    this.logger.log({ payloadId, gasLimit: gasLimit.toString(), attempt }, 'Submitting payload');
    
    Object payload plus a static message. Never interpolate values into the message string.
  2. 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.
  3. Audit the existing call sites for values that should never be logged, starting with the auth and oracle paths.
  4. Replace the six console.* calls with the configured logger.
  5. Document the redaction policy in CONTRIBUTING.md so new call sites follow it.

Constraints

  • Never log secret values, even temporarily — including in error paths. Check catch blocks carefully, since they are the most likely place to dump a whole object.
  • Preserve log levels; do not demote an error to log to 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/token is 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SourceXXL/alian_structure-api

All issues in SourceXXL/alian_structure-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.