Skip to content

Add request logging serializers for Pino logger configuration #455

Description

@Cjay-Cyber-2

Description

Configure custom Pino logger serializers to sanitize sensitive request and response headers (such as Authorization tokens or SEP-10 JWTs) from application log output.

Context & Requirements

Security best practices dictate that authentication credentials and sensitive tokens must never appear in log files. Pino supports custom serializers to scrub or redact headers before logs are written.

Acceptance Criteria

  • Update logger initialization in src/ to include custom serializers for req/res objects.
  • Ensure Authorization and cookie headers are redacted or masked in log output.
  • Verify that request IDs and standard telemetry fields are preserved.

Implementation Guidance

  • Likely files to touch: logger setup module (e.g., src/lib/logger.ts or src/index.ts).
  • Refer to Pino documentation on custom serializers and redaction paths.

Testing & Validation

  • Run npm test and verify application starts and logs correctly without errors.

Submission Guidelines

  • Open a Pull Request referencing Closes #<issue-number>.
  • Adhere to TypeScript strict rules and existing codebase formatting standards.

Wave complexity: Trivial

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions