Orangecat ViewLog
orangecat/viewlog
Logs GraphQL and REST API requests with detailed capture of parameters, responses, and execution times. Includes admin grids for viewing logs and configurable auto-cleanup via cron.
Build Tests
Code Quality
Tested on Magento 2.4.8-p4
Recent Test History
Each release is tested against the latest Magento version at that time.
Top Contributors
View LeaderboardShare This Module's Status
README
Loaded from GitHubOrangecat ViewLog Module
This module provides logging capabilities for GraphQL and REST API requests in Magento 2. It allows administrators to view detailed logs of API interactions, including request parameters, responses, and status codes.
Features
- GraphQL Logging: Captures GraphQL queries, variables, responses, and execution times.
- REST Logging: Captures REST API endpoints, request data, responses, and execution times.
- Admin Interface: dedicated grids to view and filter logs.
- Auto-Cleanup: Configurable retention period with automatic pruning via cron.
Installation
Install via composer:
composer require orangecat/viewlog
php bin/magento module:enable Orangecat_ViewLog
php bin/magento setup:upgrade
Configuration
Configuration is available under Stores > Configuration > Services > Magento Web API.
Graphql Logger Settings
- Enable Graphql Logger: Turn GraphQL logging on/off.
- Retention Days (Graphql): Number of days to keep logs before automatic deletion (Default: 30 days).
REST Logger Settings
- Enable REST Logger: Turn REST logging on/off.
- Retention Days (REST): Number of days to keep logs before automatic deletion (Default: 30 days).
Access
You can access the log viewers from the Admin Panel:
- GraphQL Logs:
System > Tools > Graphql Logs - REST Logs:
System > Tools > REST Logs
Cron Jobs
The module includes a cron job that runs daily at 03:00 AM to clean up logs older than the configured retention period.
orangecat_graphqlviewlog_cleanup: ExecutesOrangecat\ViewLog\Cron\Cleanup::execute
Database Tables
orangecat_graphql_log: Stores GraphQL request logs.orangecat_rest_log: Stores REST API request logs.
This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.