Download the PHP package methorz/http-request-logger without Composer
On this page you can find all versions of the php package methorz/http-request-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download methorz/http-request-logger
More information about methorz/http-request-logger
Files in methorz/http-request-logger
Package http-request-logger
Short Description PSR-3 HTTP request logging middleware with request tracking and performance monitoring
License MIT
Informations about the package http-request-logger
MethorZ Structured Logging
PSR-3 structured logging with request tracking and performance monitoring for PSR-15 applications
Automatically add request IDs and performance metrics to all logs in PSR-15 middleware applications. Zero configuration, framework-agnostic, production-ready.
โจ Features
- ๐ Request ID Tracking - Unique ID for every request, added to all logs automatically
- โฑ๏ธ Performance Monitoring - Track execution time and memory usage for requests and operations
- ๐ฏ PSR-15 Middleware - Drop-in middleware for automatic logging
- ๐ Structured Logs - JSON-compatible context for easy parsing and analysis
- ๐ง PSR-3 Compatible - Works with any PSR-3 logger (Monolog, etc.)
- ๐ Response Headers - Optionally adds
X-Request-IDheader to responses - ๐ Zero Configuration - Works out-of-the-box with sensible defaults
- ๐จ Customizable - Full control over processors and logging behavior
๐ฆ Installation
๐ Quick Start
1. Add Middleware to Your Application
That's it! Every request will now have:
- Unique request ID in all logs
- Request start/end logging
- Automatic performance metrics
- Exception logging with context
๐ Detailed Usage
Request ID Processor
Adds a unique request ID to all log records:
Custom Request ID:
Retrieve Request ID:
Performance Logger
Track performance metrics for operations:
Logged Performance Metrics:
Logging Middleware
PSR-15 middleware for automatic request logging:
What It Logs:
Request start:
Request completion:
Exception:
๐ฏ Use Cases
Distributed Tracing
Correlate logs across services using request IDs:
Performance Bottleneck Detection
Track slow operations:
Production Debugging
Find all logs for a specific request:
๐ง Configuration
Mezzio Configuration
๐ Log Structure
All logs follow a consistent structure for easy parsing:
๐ Monolog Integration
Works seamlessly with Monolog:
๐งช Testing
๐ Related Packages
This package is part of the MethorZ HTTP middleware ecosystem:
| Package | Description |
|---|---|
| methorz/http-dto | Automatic HTTP โ DTO conversion with validation |
| methorz/http-problem-details | RFC 7807 error handling middleware |
| methorz/http-cache-middleware | HTTP caching with ETag support |
| methorz/http-request-logger | Structured logging (this package) |
| methorz/openapi-generator | Automatic OpenAPI spec generation |
These packages work together seamlessly in PSR-15 applications.
๐ License
MIT License. See LICENSE for details.
๐ค Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
๐ Links
- Changelog
- Contributing
- Security
- Issues
All versions of http-request-logger with dependencies
psr/http-message Version ^1.0 || ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/log Version ^3.0