tfspl/restlogger
A Laravel package that logs incoming and outgoing REST API requests and responses, helping you debug integrations, trace errors, and monitor API activity. Configurable logging for headers, payloads, and status codes.
Architecture fit. laravel-rest-apis-logger is a Laravel package that logs REST API traffic, most likely as HTTP middleware layered into the request/response pipeline. Architecturally it is a cross-cutting observability concern rather than a domain dependency: it should sit alongside existing middleware (auth, request ID, CORS) and write through Laravel's Log facade / Monolog channels. It fits Laravel monoliths and API-only services that need request/response audit trails without adopting a full APM or gateway logging stack. It is a poor fit for non-Laravel PHP services or architectures where logging must happen outside the HTTP process (e.g., service mesh, event bus).
Integration feasibility. Installation is a standard Composer require, likely with package auto-discovery, a publishable config, and middleware registration. The 2.1.2 release is a patch and the notes describe metadata and logging changes rather than new features, so expected integration effort is low. However, PR #7 ("Update composer.json") and PR #8 ("Readme and require field updated") touch dependency constraints and documentation; PR #9 ("Log changes") touches runtime logging behavior. Those are the three areas a reviewer must actually inspect before adoption, because a patch release can still change supported-version constraints or emitted log fields without a major version bump.
Technical risk. Overall low-to-moderate for a patch, but not zero:
composer.json / require can narrow or shift the supported PHP/Laravel matrix, causing resolution conflicts or silently dropping older framework support.Key questions.
composer.json require/require-dev — PHP version, Laravel version bounds, or new transitive dependencies?Authorization, cookies, and known-sensitive fields handled?config:cache and Laravel Octane?Stack fit. Fits any Laravel application using the standard logging stack (Monolog channels, Log facade, Laravel middleware). It aligns naturally with API groups, request-ID middleware, and existing observability pipelines. It does not replace structured tracing or metrics; treat it as an audit/logging layer, not an APM substitute.
Migration path. Pin 2.x (or exactly 2.1.2) in composer.json, run composer update --dry-run first, and review the lockfile diff for unexpected transitive changes. Publish the package config, set a dedicated log channel (file, daily, or stderr for containerized environments), and register middleware in the correct group — typically the api group, ordered deliberately relative to auth so user context is either present or intentionally absent. If PR #9 changed the output schema, update log parsers and alerts in the same change window.
Compatibility. A patch release implies backward compatibility under semver, but the composer.json/require edits should be verified against the host application's PHP and Laravel versions. Test on both the lowest and highest supported framework versions, confirm package auto-discovery, and validate behavior under php artisan config:cache and, if applicable, Octane (watch for per-request state held in static properties).
Sequencing. (1) Read the PR #7–#9 diffs and changelog. (2) Install in a non-production branch and run the application test suite. (3) Diff a sample of emitted logs against the current schema and existing dashboards/alerts. (4) Deploy to staging with production-like traffic and measure latency and log volume. (5) Canary on one production service. (6) Monitor error rate, p95 latency, and log ingest cost. (7) Roll out to remaining services and document the standard config.
Maintenance. Low ongoing code footprint, but the package is community-maintained with a small contributor base. The 2.1.2 release shows active maintenance and a new contributor, which marginally improves sustainability. Assign an internal owner, track upstream releases, and review patch notes before bumping — especially any release touching composer.json or log output.
Support. GitHub issues only; no vendor SLA. Given the small surface area, an in-house middleware fallback is realistic if the package is abandoned. Maintain a pinned version and a documented fork/exit path.
Scaling. Log volume scales linearly with request rate and payload size. For high-throughput APIs, avoid full-body logging, enable sampling, use a queued or async channel, and set retention and rotation policies. Watch disk usage on file channels and ingest cost on hosted log platforms. Exclude health checks and static asset routes.
Failure modes. Log-target unavailability, disk exhaustion, latency spikes under load, log injection via unescaped headers/bodies, recursive logging of the logger's own requests, PII or credential leakage, dependency resolution conflicts after constraint edits, and silent schema drift breaking dashboards. Mitigations: fail-open logging, body-size caps, explicit redaction lists, structured JSON output, dedicated channel, resource limits, and schema assertions in tests.
Ramp-up. For a Laravel developer, adoption is measured in hours: Composer install, config publish, middleware registration, channel setup, and a staging validation pass. For a TPM, the real effort is governance — defining what gets logged, retention, redaction policy, and how the output maps to existing observability and compliance requirements — roughly one to two days including review, staging validation, and rollout planning.
How can I help you explore Laravel packages today?