Overview
The project ships a structured logging setup in src/logging/structured-logging.ts with correlation id propagation, yet several files bypass it. src/email-marketing/automation/automation.service.ts uses console.warn for an unknown action type; src/achievements/achievements.seed.ts uses console.log; and src/slack.service.ts contains three commented-out console.error/console.log lines where error reporting used to be. Output written through console directly does not carry the correlation id, the service name, or the structured fields the log aggregation pipeline under logging/ indexes on, so these events are invisible to log-based alerting and cannot be tied back to a request.
Specifications
Features:
- All application logging flows through the injected
Logger.
- A lint rule prevents new
console.* calls in src/.
Tasks:
- Replace
console.warn in automation.service.ts with this.logger.warn, including the workflow and action identifiers as structured fields.
- Replace
console.log in achievements.seed.ts with a logger instance appropriate to a seed script.
- Delete the commented-out console lines in
slack.service.ts and implement real error logging there.
- Enable the
no-console ESLint rule for src/** with a narrow exception for genuine CLI scripts.
Impacted Files:
src/email-marketing/automation/automation.service.ts
src/achievements/achievements.seed.ts
src/slack.service.ts
.eslintrc.js
Acceptance Criteria
- No
console.* call remains in src/ outside explicitly-exempted CLI scripts.
- The replaced log lines carry correlation ids and structured fields.
npm run lint:ci fails on a newly introduced console.log.
Overview
The project ships a structured logging setup in
src/logging/structured-logging.tswith correlation id propagation, yet several files bypass it.src/email-marketing/automation/automation.service.tsusesconsole.warnfor an unknown action type;src/achievements/achievements.seed.tsusesconsole.log; andsrc/slack.service.tscontains three commented-outconsole.error/console.loglines where error reporting used to be. Output written throughconsoledirectly does not carry the correlation id, the service name, or the structured fields the log aggregation pipeline underlogging/indexes on, so these events are invisible to log-based alerting and cannot be tied back to a request.Specifications
Features:
Logger.console.*calls insrc/.Tasks:
console.warninautomation.service.tswiththis.logger.warn, including the workflow and action identifiers as structured fields.console.loginachievements.seed.tswith a logger instance appropriate to a seed script.slack.service.tsand implement real error logging there.no-consoleESLint rule forsrc/**with a narrow exception for genuine CLI scripts.Impacted Files:
src/email-marketing/automation/automation.service.tssrc/achievements/achievements.seed.tssrc/slack.service.ts.eslintrc.jsAcceptance Criteria
console.*call remains insrc/outside explicitly-exempted CLI scripts.npm run lint:cifails on a newly introducedconsole.log.