# graycore/magento2-graphql-logger

`composer require graycore/magento2-graphql-logger`

Canonical URL: https://packagento.com/graycore/magento2-graphql-logger

## At a glance

- **Vendor**: graycore (https://packagento.com/graycore.md)
- **Latest version**: v0.2.3 — released 2026-05-18
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/graycore/magento2-graphql-logger and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require graycore/magento2-graphql-logger:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## README

<div align="center">

[![Packagist Downloads](https://img.shields.io/packagist/dm/graycore/magento2-graphql-logger?color=blue)](https://packagist.org/packages/graycore/magento2-graphql-logger/stats)
[![Packagist Version](https://img.shields.io/packagist/v/graycore/magento2-graphql-logger?color=blue)](https://packagist.org/packages/graycore/magento2-graphql-logger)
[![Packagist License](https://img.shields.io/packagist/l/graycore/magento2-graphql-logger)](https://github.com/graycoreio/magento2-graphql-logger/blob/main/LICENSE)
[![MageCheck Status](https://img.shields.io/github/actions/workflow/status/graycoreio/magento2-graphql-logger/check-extension.yaml?&label=MageCheck&labelColor=1a1a1a)](https://github.com/graycoreio/magento2-graphql-logger/actions/workflows/check-extension.yaml)
![MageCheck Supported Version](https://img.shields.io/badge/currently_supported-any?label=MageCheck%20Supported&labelColor=1a1a1a&color=090c9b)

</div>

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](https://getcomposer.org/). From the root of your Magento 2 project:

1. Download the package
```bash
composer require graycore/magento2-graphql-logger
```
2. Enable the package

```bash
./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](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.2.3](https://github.com/graycoreio/magento2-graphql-logger/compare/v0.2.2...v0.2.3) (2026-05-18)


#### Miscellaneous Chores

* **deps-dev:** upgrade to phpunit/phpunit:^12 and magento/magento-coding-standard:^40 ([ac225dc](https://github.com/graycoreio/magento2-graphql-logger/commit/ac225dca09118156fdd9237767e6e70d93661c1f))
* **deps-dev:** upgrade to phpunit/phpunit:^12 and magento/magento-coding-standard:^40 ([18c4b22](https://github.com/graycoreio/magento2-graphql-logger/commit/18c4b22a05cfa0cbf699c2c12b621952375ab1ef))
* **deps:** bump graycoreio/github-actions-magento2 from [@main](https://github.com/main) to 8.2.0 ([81e4f23](https://github.com/graycoreio/magento2-graphql-logger/commit/81e4f23aec14493a1143646acf58b638d3b97e56))

### [0.2.2](https://github.com/graycoreio/magento2-graphql-logger/compare/v0.2.1...v0.2.2) (2026-03-03)


#### Miscellaneous Chores

* remove unused nodejs deps ([99a9630](https://github.com/graycoreio/magento2-graphql-logger/commit/99a96303638491d2fb3a07e8cac080ce7c06a6cf))

### [0.2.1](https://github.com/graycoreio/magento2-graphql-logger/compare/v0.2.0...v0.2.1) (2025-10-23)


#### Bug Fixes

* remove extraneous comment node on db.xml ([4700ab7](https://github.com/graycoreio/magento2-graphql-logger/commit/4700ab7830fb0516808444e4fc3815b647c30069))

### [0.2.0](https://github.com/graycoreio/magento2-graphql-logger/compare/v0.1.1...v0.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](https://github.com/graycoreio/magento2-graphql-logger/commit/0c52ca4a827d923f693cb31022f5c2b6006568ae))

#### 0.1.1 (2022-07-26)

## Recent Versions

| Version | Released |
|---|---|
| v0.2.3 | 2026-05-18 |
| v0.2.2 | 2026-03-03 |
| v0.2.1 | 2025-10-23 |
| v0.2.0 | 2025-04-11 |
| v0.1.1 | 2022-07-26 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | * |
| magento/module-graph-ql | ^100.0.0 |
| php | >=8.2 |

### Require (dev)

| 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 |

## Quality

Latest release (v0.2.3) passes the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — 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.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Pass | 0 |  |
| PHPMD | Warning | 2 | 2 rule violations (UnusedFormalParameter:2) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 3 | valid; 3 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["graycore/magento2-graphql-logger"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

graycore is a Magento 2 vendor on Packagento. See https://packagento.com/graycore.md for their full catalogue.

