Log Level Filtering for PHP Built-in Server
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
Hi,
We use the PHP 8.3 built-in server during development, and it has been very helpful. However, there is an excessive amount of stdout output. For every request to resources like images, JS, or CSS files, it logs messages such as Accepted, GET, Closing, etc.
Because of this, it becomes very difficult to see the stdout output or error messages from within the application itself. I couldn't find an option to filter these logs. A feature like loglevel could be helpful to manage this.
For example:
php -S 0.0.0.0:8086 -t ./public --loglevel 4
This would allow filtering logs based on levels (e.g., errors, warnings, info, etc.), making it easier to focus on application-specific outputs during development.
Additionally, the PHP built-in server outputs all logs to stderr, which seems like a bug. Ideally, standard logs should go to stdout and error messages to stderr.
PHP built-in server output like:
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 the PHP 8.3 built-in server command path invoked by php -S, and trace how request logs and application errors are emitted. Define the expected log-level filtering and stdout/stderr behavior, then add coverage showing that selected messages are filtered and standard logs are separated from errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100