npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

strapi-plugin-logz

v0.1.0

Published

Automatically capture and record the API calls made to your Strapi application

Readme

Strapi Plugin Logz

Automatically capture and record the API calls made to your Strapi application

Screenshot of an imported design

💸 Support Me

If you can 😊

⚙️ Version

This plugin is compatible with Strapi v5.

💻 Prerequisites

  • Node v20+ (I recommend using nvm, there is a windows and mac/linux version)
  • A Strapi v5 project (npx create-strapi-app@latest my-project)

⬇️ Installation

Install the plugin by running the following command:

npm install strapi-plugin-logz

🎚️ Plugin Configuration

All options are optional.

// config/plugins.ts
export default ({ env }) => ({
  logz: {
    enabled: true,
    config: {
      // Skip logging for these APIs or plugins (by name).
      // "car" skips every request sent to /api/cars
      skipList: ["car", "upload"],
      // Skip logging for these route paths (as defined in Strapi, without the /api prefix)
      skipEndpoints: ["/auth/local", "/articles/:id"],
      // Delete logs older than 90 days
      retentionDays: 90,
      // Also store request bodies, without these keys
      logRequestBody: true,
      redactKeys: ["phoneNumber"],
    },
  },
});

| Option | Type | Default | Description | | ---------------- | ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- | | skipList | string[] | [] | API names (e.g. article) or plugin names (e.g. users-permissions) to skip | | skipEndpoints | string[] | [] | Route paths to skip, e.g. /auth/local or /articles/:id | | retentionDays | number \| null | null | Delete logs older than this many days. Runs 30 seconds after startup, then every hour. null keeps logs forever | | logOwnRequests | boolean | false | Also log requests made to the Logz REST API (/api/logz/...) | | logIpAddress | boolean | true | Store the client's IP address. Behind a reverse proxy, enable Strapi's proxy server option so the client's IP is used | | logRequestBody | boolean | false | Store request bodies. Passwords, tokens and redactKeys are removed; bodies over 10,000 characters are replaced with a placeholder | | redactKeys | string[] | [] | Extra keys removed from stored request and response bodies, at any depth (case insensitive) |

The LogzConfig type is exported if you want to type your configuration:

import type { LogzConfig } from "strapi-plugin-logz/strapi-server";

▶️ Usage

After installing, you can access the Logz Dashboard by navigating to the Logz section in the admin panel.

  • Dashboard: totals and charts for the last 7 days or 7 months.
  • View logz: a searchable list of every log. Filter by method, status (2xx, 4xx, ...) and date, search by URL, action, user, IP or API token, sort by date or duration, and open a log to see everything that was stored.
  • Download logz: export the logs for a date range as CSV.

Admin Area

Content Manager Area

🔐 Permissions

  • Admin dashboard: give a role the Allow Logz dashboard access permission in Settings → Administration Panel → Roles → Plugins → Logz. Super Admins have it by default. The dashboard API (/logz/*) requires an authenticated admin with this permission.
  • REST API: the content API routes (/api/logz/*) are disabled by default. Enable the ones you need for a role in Settings → Users & Permissions plugin → Roles → Logz.

📝 What gets logged

Every request to the content API (/api/*, or your custom api.rest.prefix) is logged after it is handled. Admin panel requests are not logged. Logs are written in the background, so logging never slows down or breaks a request.

Each log stores:

  • the method, URL, status code and a readable action (e.g. Created a new Article, Logged in)
  • who made the request: the user (including the user who just logged in or registered) or the name of the API token
  • how long the request took, the IP address and the user agent
  • the request body, when logRequestBody is enabled
  • some data about the response:
    • List requests (GET without route params): a summary (5 record(s) fetched) and the query, not the full payload.
    • Other successful requests: the response body.
    • Failed requests (status 400+): the error response.
    • Non-JSON responses (files, streams): a placeholder.

Tokens and passwords (jwt, token, refreshToken, password, ...) and your redactKeys are removed from stored bodies at any depth.

Requests to the Logz REST API itself are not logged unless logOwnRequests is enabled.

🌐 REST API

| Method | Path | Description | | ------ | ------------------------------ | ------------------------------------------------------------------------------------ | | GET | /api/logz | List logs. Supports the usual filters, sort, pagination, populate | | GET | /api/logz/:id | Get one log by id or documentId | | GET | /api/logz/download | Download logs as CSV (streamed). Optional start & end (YYYY-MM-DD or ISO date) | | GET | /api/logz/dashboard-totals | Total requests, logins, registrations and errors | | GET | /api/logz/requests-over-time | Requests per day/month. filterBy=week (default) or month | | GET | /api/logz/login-vs-register | Logins vs registrations per day/month. filterBy=week or month | | GET | /api/logz/most-accessed | Requests per method for the period. filterBy=week or month |

🚀 Services

Find

await strapi.plugin("logz").service("logz").find(QUERY_PARAMS_OBJECT);

FindOne

await strapi.plugin("logz").service("logz").findOne(ID, QUERY_PARAMS_OBJECT);

Delete old logs

// Delete every log created before a date
await strapi.plugin("logz").service("logz").deleteBefore(new Date("2025-01-01"));
// Apply the `retentionDays` configuration now
await strapi.plugin("logz").service("logz").applyRetention();

Count

await strapi
  .plugin("logz")
  .service("logz")
  .count({ where: { method: "GET" } });

📝 License

This project is licensed under the MIT License - see the LICENSE file for details