feat: implement comprehensive pino logging across server-side code#31
feat: implement comprehensive pino logging across server-side code#31asithade merged 8 commits intorefactor/project-uidfrom
Conversation
Signed-off-by: Asitha de Silva <asithade@gmail.com>
- Add file upload functionality to meeting creation form - Implement immediate file uploads with progress indicators - Create reusable file upload component wrapper for PrimeNG - Add attachment display in meeting cards with file type icons - Support for PDF, Word, Excel, PowerPoint, and image files - REST API integration with Supabase storage (no SDK required) - Created pipes for file type icons and file size formatting - Add attachment CRUD operations in backend API - Store attachment metadata in meeting_attachments table - Display attachments in meeting cards for all scenarios - Combine attachments and important links in unified resource section 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Asitha de Silva <asithade@gmail.com>
- Extract duplicated allowed file types array to ALLOWED_FILE_TYPES constant - Extract file size limits to MAX_FILE_SIZE_BYTES constant - Move filename sanitization to reusable sanitizeFilename utility in utils folder - Remove code duplication between upload endpoints in meetings.ts Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com>
Signed-off-by: Asitha de Silva <asithade@gmail.com>
- Add application/vnd.ms-excel and application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for Excel files - Add application/vnd.ms-powerpoint and application/vnd.openxmlformats-officedocument.presentationml.presentation for PowerPoint files - File type icon pipe already supports these file types Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com>
- Replace all console.log/console.error statements with structured pino logging - Implement dual logger architecture: serverLogger for non-request context, req.log for request-scoped logging - Add comprehensive comments explaining logging architecture in server.ts - Use snake_case convention for all log properties for consistency - Protect PII by removing sensitive data (names, emails, topics) and using boolean flags - Add structured logging to all routes with operation context, timing, and status codes - Enhance error handling with detailed logging in middleware and services - Add retry and failure logging to API client service with proper error context - Configure pino with appropriate redaction for sensitive headers and tokens - Environment-aware stack trace logging (development only) Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com>
Signed-off-by: Asitha de Silva <asithade@gmail.com>
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This PR implements comprehensive structured logging using Pino across the server-side codebase, replacing all console statements with proper logging infrastructure. The implementation introduces a dual logger architecture with PII protection and environment-aware configurations.
- Establishes dual logger system with serverLogger for server operations and req.log for request-scoped logging
- Replaces all console.log/error statements with structured Pino logging using snake_case conventions
- Adds comprehensive operation timing, error context, and retry logic logging with PII protection
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/lfx-pcc/src/server/server.ts | Sets up dual Pino logger architecture with PII redaction and exports serverLogger |
| apps/lfx-pcc/src/server/services/microservice-proxy.service.ts | Replaces console.error with structured logging and PII protection |
| apps/lfx-pcc/src/server/services/api-client.service.ts | Adds comprehensive retry and error logging with structured context |
| apps/lfx-pcc/src/server/routes/projects.ts | Implements operation timing and structured logging for all project endpoints |
| apps/lfx-pcc/src/server/routes/meetings.ts | Adds comprehensive logging for meeting operations with timing and validation context |
| apps/lfx-pcc/src/server/routes/committees.ts | Implements structured logging for committee operations with timing and error context |
| apps/lfx-pcc/src/server/middleware/error-handler.middleware.ts | Updates error handler to use request-scoped logging |
| apps/lfx-pcc/src/server/middleware/auth-token.middleware.ts | Adds authentication flow logging with debug and warning levels |
✅ E2E Tests PassedBrowser: chromium All E2E tests passed successfully. Test Configuration
|
* feat: implement committee management for meetings - Add committee association functionality to meetings with modal interface - Display committee members with deduplication and enhanced table styling - Prevent editing of committee members with informational messages - Support multi-select committee dropdown with dynamic helper text - Cache committee member data to optimize API calls - Show voting columns only when committees have voting enabled 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * refactor: optimize committee modal table and member display - Fix incorrect colspan calculation using computed property - Replace forEach with flatMap for better performance in member collection - Implement single-pass deduplication instead of array mutation - Add duplicate committee name prevention for members 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: enhance committee modal with testing support and memory leak prevention - Add data-testid attributes to multi-select and action buttons for reliable E2E testing - Implement takeUntilDestroyed for automatic subscription cleanup - Follow project testing guidelines with hierarchical testid naming convention - Prevent memory leaks in valueChanges subscription 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * perf: optimize committee member deduplication with O(n) Map-based algorithm Replace inefficient O(n²) flatMap/reduce/find chain with Map-based deduplication for better performance with large committee member datasets. - Use Map<email, member> for O(n) lookups instead of O(n²) array operations - Add null safety check for member email addresses - Consolidate duplicate imports for cleaner code - Maintain same functionality while improving scalability Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Asitha de Silva <asithade@gmail.com> * fix: hide members length while loading members Signed-off-by: Asitha de Silva <asithade@gmail.com> * refactor: project uid Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: enhance meeting cards with participant response breakdown and improved link visibility (#27) * feat: implement committee management for meetings - Add committee association functionality to meetings with modal interface - Display committee members with deduplication and enhanced table styling - Prevent editing of committee members with informational messages - Support multi-select committee dropdown with dynamic helper text - Cache committee member data to optimize API calls - Show voting columns only when committees have voting enabled 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * refactor: optimize committee modal table and member display - Fix incorrect colspan calculation using computed property - Replace forEach with flatMap for better performance in member collection - Implement single-pass deduplication instead of array mutation - Add duplicate committee name prevention for members 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: enhance committee modal with testing support and memory leak prevention - Add data-testid attributes to multi-select and action buttons for reliable E2E testing - Implement takeUntilDestroyed for automatic subscription cleanup - Follow project testing guidelines with hierarchical testid naming convention - Prevent memory leaks in valueChanges subscription 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: enhance meeting cards with participant response breakdown and improved link visibility - Add participants_accepted_count, participants_declined_count, and participants_pending_count fields to Meeting interface - Update meeting card component to display response breakdown (e.g., "5 Guests (3 Attending, 1 Not Attending, 1 Pending Response)") - Move important links outside expandable text for better visibility and immediate access - Only show response breakdown when there are individual participants with response data - Improve meeting organizer visibility into participation status and key meeting resources 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> --------- Signed-off-by: Asitha de Silva <asithade@gmail.com> * fix: build issues Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: add complete meeting attachments functionality with file upload (#29) * refactor: rename projectId to projectUid Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: add complete meeting attachments functionality with file upload - Add file upload functionality to meeting creation form - Implement immediate file uploads with progress indicators - Create reusable file upload component wrapper for PrimeNG - Add attachment display in meeting cards with file type icons - Support for PDF, Word, Excel, PowerPoint, and image files - REST API integration with Supabase storage (no SDK required) - Created pipes for file type icons and file size formatting - Add attachment CRUD operations in backend API - Store attachment metadata in meeting_attachments table - Display attachments in meeting cards for all scenarios - Combine attachments and important links in unified resource section 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Asitha de Silva <asithade@gmail.com> * refactor: extract file upload constants to shared package - Extract duplicated allowed file types array to ALLOWED_FILE_TYPES constant - Extract file size limits to MAX_FILE_SIZE_BYTES constant - Move filename sanitization to reusable sanitizeFilename utility in utils folder - Remove code duplication between upload endpoints in meetings.ts Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * refactor: remove unused messages module Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: add Excel and PowerPoint file support to uploads - Add application/vnd.ms-excel and application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for Excel files - Add application/vnd.ms-powerpoint and application/vnd.openxmlformats-officedocument.presentationml.presentation for PowerPoint files - File type icon pipe already supports these file types Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> --------- Signed-off-by: Asitha de Silva <asithade@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> * feat: implement comprehensive pino logging across server-side code (#31) * refactor: rename projectId to projectUid Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: add complete meeting attachments functionality with file upload - Add file upload functionality to meeting creation form - Implement immediate file uploads with progress indicators - Create reusable file upload component wrapper for PrimeNG - Add attachment display in meeting cards with file type icons - Support for PDF, Word, Excel, PowerPoint, and image files - REST API integration with Supabase storage (no SDK required) - Created pipes for file type icons and file size formatting - Add attachment CRUD operations in backend API - Store attachment metadata in meeting_attachments table - Display attachments in meeting cards for all scenarios - Combine attachments and important links in unified resource section 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Asitha de Silva <asithade@gmail.com> * refactor: extract file upload constants to shared package - Extract duplicated allowed file types array to ALLOWED_FILE_TYPES constant - Extract file size limits to MAX_FILE_SIZE_BYTES constant - Move filename sanitization to reusable sanitizeFilename utility in utils folder - Remove code duplication between upload endpoints in meetings.ts Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * refactor: remove unused messages module Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: add Excel and PowerPoint file support to uploads - Add application/vnd.ms-excel and application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for Excel files - Add application/vnd.ms-powerpoint and application/vnd.openxmlformats-officedocument.presentationml.presentation for PowerPoint files - File type icon pipe already supports these file types Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: implement comprehensive pino logging across server-side code - Replace all console.log/console.error statements with structured pino logging - Implement dual logger architecture: serverLogger for non-request context, req.log for request-scoped logging - Add comprehensive comments explaining logging architecture in server.ts - Use snake_case convention for all log properties for consistency - Protect PII by removing sensitive data (names, emails, topics) and using boolean flags - Add structured logging to all routes with operation context, timing, and status codes - Enhance error handling with detailed logging in middleware and services - Add retry and failure logging to API client service with proper error context - Configure pino with appropriate redaction for sensitive headers and tokens - Environment-aware stack trace logging (development only) Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * fix: disable token middleware (#30) Signed-off-by: Asitha de Silva <asithade@gmail.com> --------- Signed-off-by: Asitha de Silva <asithade@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> * fix: increase express body limit to 15mb and complete pino logging migration - Increase express.json limit from 1mb to 15mb to support Base64 file uploads up to 10mb - Convert remaining console statements in meeting attachment routes to req.log - Add tokenRefreshMiddleware back to server configuration - Ensure all server-side logging uses structured pino format with snake_case properties - File upload endpoints now properly support 10mb files (~13mb when Base64 encoded) Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * feat: enhance file upload security and reorganize shared package utilities This commit implements comprehensive improvements to the file upload system and reorganizes the shared package for better maintainability. File Upload Security Enhancements: - Add client-side file validation (size, type, duplicates, filename security) - Fix RxJS subscription pattern using proper defer/switchMap operators - Remove duplicate Express route handlers in meetings.ts - Harden filename sanitization with comprehensive security checks - Fix data-testid convention for consistent E2E testing Shared Package Reorganization: - Move timezone utility functions from constants to utils folder - Create new timezone.utils.ts with getTimezoneByValue, getUserTimezone, formatTimezoneWithCurrentTime - Update import paths across codebase to use proper utility locations - Maintain proper separation of concerns between constants and utilities Technical Improvements: - Increase Express body limit from 1mb to 15mb for Base64 file uploads - Implement proper error handling with structured logging on server side - Add comprehensive filename security checks (path traversal, Windows reserved names, Unicode normalization) - Replace nested Observable subscriptions with proper RxJS operators - Add immediate client-side feedback for file validation errors All changes tested and verified: - Build passes successfully - Linting standards maintained - License headers properly applied - Import paths resolve correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> --------- Signed-off-by: Asitha de Silva <asithade@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
Summary
Key Changes
Technical Details
Generated with Claude Code