Commit Graph

8 Commits

Author SHA1 Message Date
Daniel Pupius
41ee61b59a Updated logging configuration for dev and json for prod 2025-04-21 14:16:35 -07:00
Daniel Pupius
0f151c31b9 Improve structured logging for better log aggregation
- Add message type prefix in brief mode for quick identification
- Include GatewayID in brief mode summary
- Remove formatted output from structured fields
- Use proper structured fields for each message type
- Add common fields like hopLimit and ID for all messages
- Extract specific data for position, telemetry, and text messages
- Format structured data for better log aggregation compatibility
2025-04-21 11:52:40 -07:00
Daniel Pupius
c6d94b10d1 Inject loggers from main.go instead of creating them locally
- Update all components to accept a logger parameter
- Add default fallbacks when logger is not provided
- Ensure consistent logger naming with parent.Named() pattern
- Create a proper logger hierarchy originating from main.go
- Update MessageLogger to pass logger to BaseSubscriber
2025-04-21 11:09:27 -07:00
Daniel Pupius
9447f44139 Update logging to use prefab/logging package
- Replace standard log package with prefab/logging
- Add context-aware logging in HTTP handlers
- Add structured logging with fields and levels
- Improve logging hierarchy and namespaces
- Implement named loggers for components
2025-04-21 11:01:45 -07:00
Daniel Pupius
9c438713de Add graceful shutdown for SSE connections
Add atomic shutdown flag and shutdown channel to handle graceful
termination of Server-Sent Events connections. This ensures:

1. New connections are rejected with a proper status code during shutdown
2. Existing connections receive a notification before being closed
3. All subscriber channels are properly unsubscribed from the broker

This implementation safely handles multiple in-flight requests during
shutdown by using an atomic flag to track server state.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-04-21 10:38:59 -07:00
Daniel Pupius
52ed85ed23 Send complete packet object to SSE clients 2025-04-21 10:13:30 -07:00
Daniel Pupius
ed1e719bca Add SSE endpoint for streaming MQTT messages to web browsers 2025-04-21 10:01:05 -07:00
Daniel Pupius
758aaa0dc0 Add web server using prefab framework 2025-04-21 09:53:04 -07:00