Make log format more customizable

Open
#99 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
observability

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.

Description

status:ready for adoption type:enhancement
  1. Allow to set own callable for convert value to string (https://github.com/yiisoft/log/blob/master/src/Message/Formatter.php#L257)
  2. 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.
Dominant language
PHP
Stars
43
Forks
24
Avg merge
55m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yiisoft/log

All issues in yiisoft/log

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.