Skip to content

Conversation

@ParidelPooya
Copy link
Contributor

Description of changes:

  • Replace unstructured console.log output with proper JSON format
  • Fix default logger to output single JSON object per log entry
  • Use appropriate console methods (info, error, warn, debug) for each log level
  • Add TypeScript documentation with examples and circular reference warnings
  • Maintain backward compatibility with custom loggers (AWS Powertools, Winston, etc.)
  • Remove unnecessary fallback logic since context logger always provides structured data
  • Update tests to verify structured JSON output format

This resolves the issue where logs were producing nested/duplicated strings instead of clean structured JSON that AWS Lambda can properly parse and log aggregators can query efficiently.

Issue #, if available:
#302

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…gging

- Remove JSON.stringify from default logger to let AWS Lambda handle serialization
- Update unit tests to expect raw objects instead of stringified JSON
- Update documentation to reflect structured logs output
- Aligns with AWS Lambda best practices for console logging
@ParidelPooya ParidelPooya force-pushed the feat/structured-logging-improvements branch from 31a3910 to df4f852 Compare November 21, 2025 19:47
@ParidelPooya ParidelPooya marked this pull request as ready for review November 21, 2025 19:51
@ParidelPooya ParidelPooya merged commit 8d74dd2 into development Nov 21, 2025
13 checks passed
@ParidelPooya ParidelPooya deleted the feat/structured-logging-improvements branch November 21, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants