25carat/oro-api-logger
Logs all OroCommerce REST API requests and responses for monitoring integrations. Adds a dedicated api_logger channel writing to api-logger-[env].log with configurable minimum level; headers at info, bodies at debug, client errors at error, server errors at critical.
Pros:
RestApiController decorator pattern, ensuring seamless integration with minimal architectural disruption.api_logger channel, enabling tailored observability without cluttering primary logs.api-logger-[env].log), simplifying log management and reducing noise in application logs.Cons:
debug level).Critical Risks:
debug level could degrade API performance, especially under high traffic. Mitigation: Default to info/error levels and monitor.twenty5carat.api_logger.level parameter causes service container failures. Requires CI/CD validation or documentation enforcement.Moderate Risks:
RestApiController usage; custom routes or middleware may need additional configuration.Low Risks:
debug logging be feasible, or should it default to info/error to avoid performance degradation?debug in staging, error in production)? Will this be managed via configuration files or environment variables?Primary Use Cases:
info/debug levels enable analysis of latency bottlenecks (e.g., slow API responses, large payloads) without modifying core code.Stack Compatibility:
api-logger-[env].log). For distributed systems, integrate with:
Pre-Integration:
Installation:
composer require 25carat/oro-api-logger
parameters.yml.dist:
parameters:
twenty5carat.api_logger.level: info # Start with info; adjust based on needs
php bin/console cache:clear
Post-Integration:
var/log/api-logger-[env].log and include expected data (headers, bodies, timestamps).ElasticsearchHandler, SyslogHandler) to forward logs.RestApiController usage. Custom controllers or middleware may require additional configuration (e.g., decorating custom controllers).Monolog\Handler\DatabaseHandler).Phase 1: Development/Staging
debug logging to capture full request/response details for comprehensive debugging.Phase 2: Pre-Production
info or `errorHow can I help you explore Laravel packages today?