wulf-pulse/lib/services
root e25eb3fa5e feat: implement structured logging for sync operations
- Add comprehensive structured logging utility (lib/utils/sync-logger.ts)
  - Log levels: DEBUG, INFO, WARN, ERROR
  - Automatic error categorization (NETWORK_ERROR, AUTH_ERROR, DATABASE_ERROR, etc.)
  - Phase tracking (INITIALIZING, FETCHING, MAPPING, VALIDATING, UPSERTING, DELETING, COMPLETING)
  - Contextual metadata (syncId, entityType, phase, duration, record counts)
  - Timing helpers for operations

- Update sync-service.ts with structured logging
  - Replace console.log/error with structured logger
  - Consistent error categorization across all error paths
  - Fix swallowed errors in sync history updates
  - Add child loggers for entity-specific operations

- Update entity-sync.ts with structured logging
  - Complete phase tracking throughout sync lifecycle
  - Detailed context for warnings and errors
  - Update chunked sync methods with structured logging
  - Update picklist sync methods (issue types, sub-issue types)
  - Better debugging info with timing and sample data

- Add sync failure analysis script (scripts/analyze-sync-failures.ts)
  - Query sync history by date range, entity type, or status
  - Generate failure summaries by entity
  - Automatic error categorization
  - Calculate success rates and statistics
  - Display detailed sync records with timing

- Add comprehensive documentation (docs/SYNC_LOGGING_IMPROVEMENTS.md)
  - Usage guide and examples
  - Migration guide for developers
  - Before/after comparisons

This addresses inconsistent logging and improves debugging capabilities for sync operations.
2026-01-23 08:02:02 -05:00
..
addigy-client.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
addigy-factory.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
analytics-engine.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
analytics-integration.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
autotask-client.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
autotask-factory.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
auvik-client.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
auvik-factory.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
background-processor.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
cache.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
datto-rmm-client-simple.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
datto-rmm-client.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
datto-rmm-factory.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
entity-sync.ts feat: implement structured logging for sync operations 2026-01-23 08:02:02 -05:00
issue-type-assignment.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
llm-analyzer.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
performance-optimizer.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
postgres-client.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
rate-limiter.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
redis-client.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
sync-progress-tracker.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
sync-service.ts feat: implement structured logging for sync operations 2026-01-23 08:02:02 -05:00