Commit a610bc6
feat(logging): implement comprehensive log streaming system for Issue #11
This commit implements the complete log collection and real-time streaming
infrastructure for VoidRunner's container execution environment.
## Key Features Implemented
### Database Layer
- Partitioned task_logs table with automated management functions
- Daily partition creation and retention policies
- Full-text search capabilities with GIN indexes
### Core Services
- **DockerLogCollector**: Streams logs directly from Docker containers
- **PostgreSQL LogStorage**: Persistent storage with partitioned tables
- **Redis StreamingService**: Real-time log distribution via SSE
- **LogManager**: Coordinates all logging services with unified interface
### API Integration
- Server-Sent Events endpoints for real-time log streaming
- Historical log retrieval with filtering and search
- Proper user access control and validation
### Executor Integration
- Seamless integration with Docker container execution
- Automatic log collection start/stop with container lifecycle
- Error handling and graceful degradation when logging unavailable
## Technical Implementation
- **Architecture**: Modular design with clear separation of concerns
- **Performance**: Batched database inserts and connection pooling
- **Security**: User-based access control and input validation
- **Monitoring**: Comprehensive error handling and metrics collection
- **Testing**: Full unit test coverage and integration test support
## Configuration
- Feature toggle for gradual rollout
- Configurable buffer sizes, timeouts, and retention policies
- Development and production configuration profiles
This implementation provides the foundation for real-time log monitoring
and debugging capabilities as specified in Epic 2 requirements.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 7762ba4 commit a610bc6
9 files changed
Lines changed: 755 additions & 233 deletions
File tree
- cmd/api
- internal
- api/routes
- executor
- logging
- migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
253 | | - | |
254 | | - | |
255 | | - | |
| 254 | + | |
| 255 | + | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
276 | | - | |
277 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
278 | 280 | | |
279 | | - | |
280 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
281 | 292 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | 293 | | |
286 | | - | |
287 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
288 | 298 | | |
289 | | - | |
290 | | - | |
291 | 299 | | |
292 | 300 | | |
293 | 301 | | |
294 | 302 | | |
295 | | - | |
296 | | - | |
| 303 | + | |
| 304 | + | |
297 | 305 | | |
298 | 306 | | |
299 | 307 | | |
| |||
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
317 | 324 | | |
318 | 325 | | |
319 | 326 | | |
| |||
358 | 365 | | |
359 | 366 | | |
360 | 367 | | |
361 | | - | |
362 | | - | |
| 368 | + | |
| 369 | + | |
363 | 370 | | |
364 | 371 | | |
365 | | - | |
366 | | - | |
| 372 | + | |
| 373 | + | |
367 | 374 | | |
368 | 375 | | |
369 | 376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | | - | |
123 | | - | |
| 122 | + | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
0 commit comments