graycore / magento2-graphql-logger
graycore/magento2-graphql-logger
Magento 2 GraphQL Logger
This module logs unique GraphQl queries for development purposes.
[!CAUTION]
If your frontend development teams are unscrupulous this package will generate a PII issue for you. We append full query body data into the logs. This means that developers who fail to use variables in their queries and instead embed them directly in the query will cause your logs to be pull of various kinds of data that you don't want to log (potentially PII and credit card data). This uses the same interface as New Relic (which means New Relic and any other configured loggers) will ALSO get this data. You should only install this in development environments. You have been warned.
Getting Started
This module is intended to be installed with composer. From the root of your Magento 2 project:
- Download the package
composer require graycore/magento2-graphql-logger
- Enable the package
./bin/magento module:enable Graycore_GraphQlLogger
Usage
This module is disabled by default. It can be enabled through system configuration: Services -> Magento Web API -> GraphQl Logger -> Enable Logger.
Logs can be found in graycore_graphql_log in the database.
Changelog
All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
0.2.3 (2026-05-18)
Miscellaneous Chores
- deps-dev: upgrade to phpunit/phpunit:^12 and magento/magento-coding-standard:^40 (ac225dc)
- deps-dev: upgrade to phpunit/phpunit:^12 and magento/magento-coding-standard:^40 (18c4b22)
- deps: bump graycoreio/github-actions-magento2 from @main to 8.2.0 (81e4f23)
0.2.2 (2026-03-03)
Miscellaneous Chores
- remove unused nodejs deps (99a9630)
0.2.1 (2025-10-23)
Bug Fixes
- remove extraneous comment node on db.xml (4700ab7)
0.2.0 (2025-04-11)
⚠ BREAKING CHANGES
- We no longer plugin around the query processor (which is a good thing). However, Magento's out-of-box log data doesn't give the exact query sent. This is likely due to the fact that it is possible for mutation data like user passwords to appear in the log if developers fail to use variables appropriately. However, I'm not going to compensate for naive developers. To keep existing functionality, we've added the full query (not variables) to the log data when this package is enabled. I would avoid using this in production environments if at all possible if you're concerned about the quality of your development team.
Features
- replace plugin with LoggerInterface implementation (0c52ca4)
0.1.1 (2022-07-26)
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| v0.2.3 | stable | Pass | Magento 2.4.7-2.4.9 Details | 2026-05-18 14:27:48 |
| v0.2.2 | stable | Not tested | Not yet tested Details | 2026-03-03 18:41:39 |
| v0.2.1 | stable | Not tested | Not yet tested Details | 2025-10-23 17:17:50 |
| v0.2.0 | stable | Not tested | Not yet tested Details | 2025-04-11 17:29:43 |
| v0.1.1 | stable | Not tested | Not yet tested Details | 2022-07-26 21:26:20 |
Requires 3
| Package | Constraint |
|---|---|
| magento/framework | * |
| magento/module-graph-ql | ^100.0.0 |
| php | >=8.2 |
Requires-dev 4
| Package | Constraint |
|---|---|
| magento/magento-coding-standard | ^40 |
| magento/php-compatibility-fork | ^0.1.0 |
| phpunit/phpunit | ^9.0 || ^10.0 || ^11.0 || ^12.0 |
| squizlabs/php_codesniffer | ^3.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from graycore
View vendorTurn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.