Make log format more customizable
Open
Nobody has claimed this yet.
status:ready for adoption
type:enhancement
- Dominant language
- PHP
- Stars
- 43
- Forks
- 24
- Avg merge
- 55m
- Merged PRs (30d)
- 1
Description
- Allow to set own callable for convert value to string (https://github.com/yiisoft/log/blob/master/src/Message/Formatter.php#L257)
- Add template (and allow user to change it) for context (https://github.com/yiisoft/log/blob/e0551896a54a91dd3c15d415167d0402c7bf9aaf/src/Message/Formatter.php#L196C22-L196C32). It should be possible to change the order of output trace, common context, message context.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/Message/Formatter.php at the referenced conversion and context-formatting locations. Read how values, trace output, common context, and message context are currently assembled. Done means callers can provide a value-to-string callable and change the context template and ordering without breaking the PSR-3 logger behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100