Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Log Subscriber

Log Subscriber Laravel Package

guzzlehttp/log-subscriber

Guzzle log subscriber that records HTTP requests and responses via any PSR-3 logger. It helps debug API integrations by logging request method and URL, response status, and other message details, making it easy to inspect traffic and monitor client behavior during development or production troublesh...

View on GitHub
Deep Wiki
Context7

[DEPRECATED] Logs HTTP requests and Responses as they are sent over the wire. Not used in Guzzle 6.

Frequently asked questions about Log Subscriber
Is guzzlehttp/log-subscriber compatible with Laravel?
Not in a Laravel-native way. guzzlehttp/log-subscriber is a Guzzle 4/5 event subscriber with no Laravel service provider, config, or facade, so you must attach it to a Guzzle client's event dispatcher and bridge its PSR-3 output to Laravel's logger. Modern Laravel uses Guzzle 6/7, where this package should not be used.
Does guzzlehttp/log-subscriber work with Guzzle 6 or 7?
No. The package is deprecated and explicitly not used in Guzzle 6, because Guzzle replaced the old event-subscriber model with middleware. For Guzzle 6/7 in Laravel, use GuzzleHttp\Middleware::log with a HandlerStack and a PSR-3 logger instead.
How do I install guzzlehttp/log-subscriber?
You can require it with Composer in a legacy project that already uses Guzzle 4/5, for example composer require guzzlehttp/log-subscriber. Do not add it to a modern Laravel application, because its constraints and runtime APIs conflict with Guzzle 6/7. Verify your composer.lock and Guzzle version before attempting installation, and expect no upstream maintenance.
What is the replacement for guzzlehttp/log-subscriber in modern Laravel?
Use Guzzle's native Middleware::log with MessageFormatter, attached to a HandlerStack and wired to a PSR-3 logger. In Laravel, route that logger to a dedicated channel with redaction, sampling, and body-size limits. This replaces the archived event subscriber without adding a legacy dependency.
Can I use guzzlehttp/log-subscriber to log API requests in Laravel?
Only in a legacy service already pinned to Guzzle 4/5, where it can log request method and URL, response status, and message details through a PSR-3 logger. For modern Laravel API integrations, use native Guzzle middleware instead. Either way, add redaction and size limits because wire-level logs can capture credentials, tokens, PII, and large bodies.
Is guzzlehttp/log-subscriber maintained and safe for production?
Treat it as high risk. The repository is archived, has low adoption, and has no active maintenance or security response, so bugs and PHP compatibility issues become your responsibility. It also does not solve redaction, sampling, retention, or structured logging, so avoid it for new development or shared platform use.
How does guzzlehttp/log-subscriber log HTTP requests and responses?
It attaches to Guzzle's event dispatcher as a subscriber and records HTTP requests and responses as they are sent over the wire. Logs typically include the request method and URL, response status, and other message details, emitted through any PSR-3 logger. It is a Guzzle 4/5 mechanism, not a Laravel HTTP client feature.
Does guzzlehttp/log-subscriber support PSR-3 loggers and Laravel logging?
Yes, it logs via any PSR-3 logger, which means it can theoretically write to a Laravel logger if you bridge the two manually. There is no Laravel service provider or configuration surface, so you must wire the subscriber into the Guzzle client and route the logger to a Laravel channel yourself. Modern Laravel setups should use Guzzle middleware instead.
Which Laravel, PHP, and Guzzle versions are supported by guzzlehttp/log-subscriber?
Treat it as Guzzle 4/5-only. Do not assume PHP 8 or modern Laravel compatibility even if Composer resolves it, because old Guzzle versions may fail at runtime. Modern Laravel requires newer Guzzle and PHP, so prove compatibility with a spike rather than assuming it.
How do I migrate from guzzlehttp/log-subscriber to Guzzle Middleware::log?
Inventory composer.lock and service code to confirm whether any Guzzle 4/5 dependency exists, then isolate the subscriber behind an internal adapter if you must keep it temporarily. Reproduce the log format with GuzzleHttp\Middleware::log and MessageFormatter, add regression tests for headers, bodies, and redaction, and then remove guzzlehttp/log-subscriber. Add a guardrail to prevent reintroduction before the next framework upgrade.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core