Commit 114a670
feat: implement AWS Lambda compatible JSON logging (#76)
* feat: implement AWS Lambda compatible JSON logging
Replace RequestContextFormatter with AWS Lambda JSON format:
- Add structured JSON output with timestamp, level, message, logger fields
- Include requestId and sessionId when available
- Add exception handling with errorType, errorMessage, stackTrace, location
- Update exception logging to use logger.exception() for proper capture
- Update tests to validate JSON format structure
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: eliminate duplicate exception logging in handler chain
Change _invoke_handler exception logging from ERROR to DEBUG level to prevent
duplicate logs when exceptions bubble up to _handle_invocation. The outer handler
provides better context with timing information.
Before: Two identical ERROR logs for same exception
After: Single ERROR log with duration metrics
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: enable debug mode in integration test to resolve timeout
Add debug=True to BedrockAgentCoreApp in test_simple_agent.py to enable
verbose logging that will help identify the root cause of the 5-minute
timeout in CI integration tests.
This provides better visibility into server startup issues.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Abhimanyu Siwach <siwabhi@amazon.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent df70612 commit 114a670
3 files changed
Lines changed: 62 additions & 28 deletions
File tree
- src/bedrock_agentcore/runtime
- tests_integ/runtime
- tests/bedrock_agentcore/runtime
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
47 | 56 | | |
48 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
49 | 66 | | |
50 | | - | |
51 | | - | |
| 67 | + | |
52 | 68 | | |
53 | 69 | | |
54 | 70 | | |
| |||
78 | 94 | | |
79 | 95 | | |
80 | 96 | | |
81 | | - | |
| 97 | + | |
82 | 98 | | |
83 | 99 | | |
84 | 100 | | |
| |||
128 | 144 | | |
129 | 145 | | |
130 | 146 | | |
131 | | - | |
| 147 | + | |
132 | 148 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 149 | + | |
136 | 150 | | |
137 | 151 | | |
138 | 152 | | |
| |||
333 | 347 | | |
334 | 348 | | |
335 | 349 | | |
336 | | - | |
337 | | - | |
| 350 | + | |
| 351 | + | |
338 | 352 | | |
339 | 353 | | |
340 | 354 | | |
| |||
365 | 379 | | |
366 | 380 | | |
367 | 381 | | |
368 | | - | |
| 382 | + | |
369 | 383 | | |
370 | | - | |
| 384 | + | |
371 | 385 | | |
372 | 386 | | |
373 | 387 | | |
| |||
413 | 427 | | |
414 | 428 | | |
415 | 429 | | |
416 | | - | |
| 430 | + | |
417 | 431 | | |
418 | 432 | | |
419 | 433 | | |
| |||
422 | 436 | | |
423 | 437 | | |
424 | 438 | | |
425 | | - | |
| 439 | + | |
426 | 440 | | |
427 | 441 | | |
428 | 442 | | |
| |||
477 | 491 | | |
478 | 492 | | |
479 | 493 | | |
480 | | - | |
| 494 | + | |
481 | 495 | | |
482 | 496 | | |
483 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1464 | 1464 | | |
1465 | 1465 | | |
1466 | 1466 | | |
| 1467 | + | |
1467 | 1468 | | |
1468 | 1469 | | |
1469 | 1470 | | |
1470 | 1471 | | |
1471 | 1472 | | |
1472 | | - | |
| 1473 | + | |
1473 | 1474 | | |
1474 | 1475 | | |
1475 | 1476 | | |
1476 | 1477 | | |
1477 | 1478 | | |
1478 | | - | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
1479 | 1486 | | |
1480 | 1487 | | |
1481 | 1488 | | |
| 1489 | + | |
1482 | 1490 | | |
1483 | 1491 | | |
1484 | 1492 | | |
1485 | 1493 | | |
1486 | 1494 | | |
1487 | | - | |
| 1495 | + | |
1488 | 1496 | | |
1489 | 1497 | | |
1490 | 1498 | | |
1491 | 1499 | | |
1492 | 1500 | | |
1493 | | - | |
1494 | | - | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
1495 | 1508 | | |
1496 | 1509 | | |
1497 | 1510 | | |
1498 | 1511 | | |
| 1512 | + | |
1499 | 1513 | | |
1500 | 1514 | | |
1501 | 1515 | | |
1502 | 1516 | | |
1503 | | - | |
| 1517 | + | |
1504 | 1518 | | |
1505 | 1519 | | |
1506 | 1520 | | |
| |||
1510 | 1524 | | |
1511 | 1525 | | |
1512 | 1526 | | |
1513 | | - | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments