feat: standardizes logging across the Notify-Chain listener service for easier debugging and monitoring. All production code now uses the centralized Winston logger with consistent structure, log levels, timestamps, and error formatting.#109
Merged
Conversation
…or easier debugging and monitoring. All production code now uses the centralized Winston logger with consistent structure, log levels, timestamps, and error formatting.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Standardizes logging across the Notify-Chain listener service for easier debugging and monitoring. All production code now uses the centralized Winston logger with consistent structure, log levels, timestamps, and error formatting.
closes #9
Changes
Logger utility (
listener/src/utils/logger.ts)formatError()helper that normalizes errors into structured objects (message,name,stack,cause)errormetadata fields are automatically formatted before loggingdebug,info,warn, anderrorlevels with consistent metadata handlingService logging consistency
"Discord notification sent successfully"log; single"Discord notification delivered"entry with full contextrequestIdper poll batch,durationMson batch/notification operations, anddebug-level empty poll cycle logsrequestIdthrough create/schedule/cancel operationsrequestIdinto scheduling calls for end-to-end traceabilitywarnwhen evicting oldest events at capacityScripts & configuration
console.log/console.errorin example scripts with structuredloggercallsLOG_LEVEL=infotolistener/.env.examplelistener/package-lock.jsonwith existingsqlite3anduuiddependenciesDocumentation & tests
listener/LOGGING.mdwith scheduler lifecycle events, registry warnings, and error formatting guidancelistener/src/utils/logger.test.tsforformatError()event-registry.test.tsto verify capacity eviction warningsCI fix
cargo fmttocontract/contracts/hello-world/src/autoshare_logic.rs(pre-existing formatting drift that would fail the Rust fmt check)Acceptance criteria
debug,info,warn,error)timestamp()format)message,name,stack, optionalcause)Test plan
cd listener && npm run build— TypeScript compiles cleanlycd listener && npx jest src/utils/logger.test.ts src/store/event-registry.test.ts src/services/discord-notification.test.ts— new and affected tests passcd dashboard && npm run lint && npm run build && npm test— CI frontend job passescd contract && cargo fmt --all -- --check && cargo test --workspace --all-features— CI Rust job passesLOG_LEVEL=debugand confirm scheduler poll cycles appearConfiguration