aagjalpankaj/logstan

PHPStan extension for Laravel applications to enforce consistent logging practices.

v0.1.1 2025-05-25 16:40 UTC

This package is auto-updated.

Last update: 2025-05-30 18:44:36 UTC


README

ci Downloads

About

Logstan is a PHPStan extension designed for Laravel applications to enforce consistent logging practices. It helps developers maintain standardized logs across their projects.

Installation | Usage | Logging standards

Installation

composer require --dev aagjalpankaj/logstan

Usage

Analyzing Logs

./vendor/bin/logstan analyse

This command will scan your application and report any inconsistencies or potential problems.

Getting Insights

./vendor/bin/logstan insights

This command provides insights about logs added in the application.

Help

For more information about available commands and options:

./vendor/bin/logstan --help

Logging standards covered

Log Message

  • Non-empty messages required
  • Maximum message length (character limit)
  • Messages must start with uppercase letters
  • No sensitive information in message content

Log Context

  • Context must be an array
  • Maximum of 10 context keys allowed
  • Keys must be non-empty strings in snake_case format
  • Values must be scalar or null (no arrays/objects are accepted)
  • Maximum value length of 100 characters
  • No sensitive information in context keys