Add configurable Monolog field name - #38
Open
pforesi wants to merge 1 commit into
Open
Conversation
- Add 'monolog_field_name' configuration option (defaults to 'request_id') - Expose field name as container parameter for use in service definitions - Add unit and acceptance tests for custom field names - Update documentation with examples and best practices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add configurable Monolog field name
Description
This PR adds the ability to customize the field name used in Monolog's
extraarray to store the request ID. Previously, the field name was hardcoded asrequest_id.What's Changed
New Configuration Option
monolog_field_nameconfiguration parameter (defaults torequest_idfor backward compatibility)%chrisguitarguy_request_id.monolog_field_name%Benefits
Usage Example
Basic usage (default behavior)
Testing
✅ All existing tests pass (24 tests, 65 assertions)
✅ Added 2 new unit tests for custom field names (Monolog v1-2 and v3+)
✅ Added acceptance test to verify container parameter is correctly defined
✅ No breaking changes
Documentation
Updated README.md with configuration details and usage examples
Updated CHANGELOG.md with the new features
Added inline code documentation
Checklist
Code follows project style guidelines
Tests added for new functionality
Documentation updated
Backward compatible
All tests passing