vitaliyboyko/magento-seq

Magento 2 local-development Seq instrumentation module

Maintainers

Package info

github.com/VitaliyBoyko/magento-seq

Type:magento2-module

pkg:composer/vitaliyboyko/magento-seq

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2026.1.0 2026-04-19 08:56 UTC

This package is auto-updated.

Last update: 2026-04-19 08:57:24 UTC


README

magento-seq is a Magento 2 module for local development only.

Do not install this in production. It is meant for developer machines where you want Magento logs and ad hoc instrumentation to flow into Seq without patching the project codebase.

What is Seq

Seq is a structured log and event server built for fast debugging. Instead of digging through flat text files, you send events with properties and then filter, search, and correlate them in a UI that is much better suited for tracing application behavior.

For local development, that is especially useful because you can inspect request flow, custom instrumentation, and Magento logs in one place with timestamps, levels, and payload fields intact.

Why Seq is useful for LLM instrumentation

LLM workflows are much easier to debug when prompts, responses, timings, model names, token counts, tool calls, and request context are captured as structured events instead of free-form text logs.

Seq is a good fit for that style of instrumentation because it lets you quickly answer questions like:

  • which prompt version caused a bad response
  • where latency increased in a multi-step pipeline
  • which tool call or API dependency failed
  • what input or session context led to a hallucination or malformed output

That makes Seq a practical local observability tool when you are iterating on AI features and need a fast feedback loop during debugging.

Support the Project

If this module is useful in your local Magento workflow, consider buying the contributor a coffee:

    ( (
     ) )
  ........
  |      |]
  \      /
   `----'
 Buy Me a Coffee

What it does

  • mirrors Magento Monolog records to Seq
  • exposes a backend instrumentation service for custom events
  • exposes a frontend helper as window.devSeq
  • exposes an anonymous REST API endpoint for storefront event collection
  • provides admin config for Seq host / URL and optional password / API key

Package name

vitaliyboyko/magento-seq

Installation

Install the module:

composer require --dev vitaliyboyko/magento-seq

Then enable it in Magento:

bin/magento module:enable VitaliiBoiko_Seq
bin/magento setup:upgrade
bin/magento cache:flush

Admin config

After install, configure the module in:

Stores -> Configuration -> Advanced -> Seq (Local Dev)

Fields:

  • Enabled
  • Seq Host / URL
  • Password / API Key

If the password field is filled, the module sends it as an X-Seq-ApiKey header.

If you enter only the Seq host, the module automatically sends to /api/events/raw?clef.

The config field is validated on save. It accepts either a plain Seq host such as http://seq:80, or the exact raw CLEF endpoint. Magento also performs a live HTTP check against the Seq server during save and shows an admin error if the server is unreachable.

Backend usage

Inject VitaliiBoiko\Seq\Api\InstrumentationInterface and call log():

<?php

declare(strict_types=1);

use VitaliiBoiko\Seq\Api\InstrumentationInterface;

class Example
{
    public function __construct(
        private readonly InstrumentationInterface $instrumentation
    ) {
    }

    public function execute(): void
    {
        $this->instrumentation->log(
            'custom.backend.event',
            ['quote_id' => 123],
            'Info'
        );
    }
}

Frontend usage

When the module is enabled, window.devSeq is available on storefront and admin pages:

window.devSeq.debug('custom.frontend.event', { quoteId: 123 });
window.devSeq.info('custom.frontend.event', { step: 'payment' });
window.devSeq.warn('custom.frontend.event', { state: 'unexpected' });
window.devSeq.error('custom.frontend.event', { reason: 'request failed' });

Frontend events are posted to Magento through the REST API and relayed server-side to Seq, so the Seq URL and password do not need to be exposed to the browser.

Seq container setup

You still need a running Seq instance for the module to send events anywhere.

Example Docker Compose service:

seq:
  image: datalust/seq:latest
  restart: unless-stopped
  environment:
    - ACCEPT_EULA=Y
    - SEQ_FIRSTRUN_NOAUTHENTICATION=true
  ports:
    - "5341:80"
    - "5342:5341"
  volumes:
    - seqdata:/data

Example volume declaration:

volumes:
  seqdata:

With that container running, a typical local Magento config value for Seq Host / URL is:

http://host.docker.internal:5341

If Magento and Seq run in the same Docker Compose network, you can usually use:

http://seq:80

You can still provide the full raw endpoint explicitly if you want:

http://seq:80/api/events/raw?clef