Skip to content

Fix: wire JSON logging, sensitive data masking, and settings into generated projects #19

@manavgup

Description

@manavgup

Problem

The README promises features that are incomplete or not wired into generated projects:

  1. JSON logginglog_format="json" is accepted by FastStackConfig but silently ignored. Only console text output works. README says "JSON + console dual-format".
  2. Sensitive data maskingmasking.py has the code, FastStackConfig.sensitive_fields accepts the config, but nothing connects them.
  3. Generated main.py ignores user settings — hardcodes FastStackConfig(app_version="0.1.0") instead of reading LOG_LEVEL from .env via settings.

Fix

  • Wire log_format and sensitive_fields into StructuredLogger.setup()
  • Add JSON formatter using python-json-logger (already a dependency)
  • Wire masking filter into the logger when sensitive_fields is configured
  • Update main.py.j2 to pass settings.log_level to FastStackConfig
  • Add tests for JSON output and masking integration

Acceptance criteria

  • log_format="json" produces JSON log output
  • sensitive_fields=["password"] masks values in logs
  • Generated main.py reads LOG_LEVEL from .env
  • All existing tests still pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions