PHPackages                             simple-as-fuck/php-performance-log - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. simple-as-fuck/php-performance-log

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

simple-as-fuck/php-performance-log
==================================

Services for logging slow parts of application.

0.5.2(1mo ago)02411UnlicensePHPPHP ^8.2CI passing

Since Aug 30Pushed 5mo agoCompare

[ Source](https://github.com/simple-as-fuck/php-performance-log)[ Packagist](https://packagist.org/packages/simple-as-fuck/php-performance-log)[ RSS](/packages/simple-as-fuck-php-performance-log/feed)WikiDiscussions 0.5 Synced 1mo ago

READMEChangelog (1)Dependencies (36)Versions (5)Used By (1)

Simple as fuck / Php performance log
====================================

[](#simple-as-fuck--php-performance-log)

Services for logging slow parts of application.

Installation
------------

[](#installation)

```
composer require simple-as-fuck/php-performance-log
```

Support
-------

[](#support)

If any PHP platform requirements in [composer.json](../composer.json) ends with security support, consider package version as unsupported except last version.

[PHP supported versions](https://www.php.net/supported-versions.php).

### Measurements support

[](#measurements-support)

ApplicationHttp requestsDB transactionsSQL queriesConsole commandsQueue JobsLaravelWith middleware use default 1 secondDefault 300 millisecondsDefault 50 millisecondsDefault offRecommended 40 seconds### Laravel application

[](#laravel-application)

Global thresholds configuration are in `performance_log.php` config, publishable from package.

```
php artisan vendor:publish --tag performance-log-config
```

For http request time logging you must register [LaravelMiddleware](../src/Middleware/LaravelMiddleware.php)as global on **first position**.

### Other applications

[](#other-applications)

All package services or listeners do not have any external dependencies except PSR interfaces, is possible use package for measurement of different types of applications.

You must register some [PerformanceLogConfig](../src/Service/PerformanceLogConfig.php) extends to your application as unique global instance (singleton), because in the service state are hold temporary [thresholds overwrites](#thresholds-overwrite), and you should overwrite methods `getConfig...`, where you can configure your global thresholds or in methods load thresholds from application configuration files.

Thresholds values has behaviour: not zero value will log longer runs then threshold value as warning, `null` or zero value turn off measurement, zero value with debug `true` will log running time as debug.

You can look at [LaravelPerformanceLogConfig](../src/Service/LaravelPerformanceLogConfig.php) as example.

You must register [listeners](../src/Listener) to your application as singletons, because most listeners has state and hold measurements data inside. [PSR-14](https://www.php-fig.org/psr/psr-14/) listeners are callables, you can register package listeners by anonymous function adapters.

You can look at [LaravelProvider](../src/Provider/LaravelProvider.php) as example.

For http request time logging you must register [PsrMiddleware](../src/Middleware/PsrMiddleware.php). Recommended usage is register middleware as global on **first position** and all of your request will be measured.

Thresholds overwrite
--------------------

[](#thresholds-overwrite)

### Sql

[](#sql)

If you know than some sql is slow, and you are fine with that you can overwrite global thresholds configuration by setting a temporary threshold in [PerformanceLogConfig](../src/Service/PerformanceLogConfig.php).

```
/** @var \SimpleAsFuck\PerformanceLog\Service\PerformanceLogConfig $performanceLogConfig */

$sqlThreshold = $performanceLogConfig->setSlowSqlQueryThreshold(null);
$transactionThreshold = $performanceLogConfig->setSlowDbTransactionThreshold(null);

// run some slow queries without annoying performance log

$sqlThreshold->restore();
$transactionThreshold->restore();
```

### Http

[](#http)

If you know that some specific controller action is slow or should be extra fast, you can overwrite global threshold configuration by setting a temporary threshold. The temporary threshold can be set anywhere in request run and live until a request ends.

```
/** @var \SimpleAsFuck\PerformanceLog\Service\PerformanceLogConfig $performanceLogConfig */

$performanceLogConfig->setSlowRequestThreshold(null);

// run some extra slow logic without annoying performance log

// no need for threshold restoring, performance listener will handle it
```

### Console

[](#console)

If you want to overwrite global threshold configuration, you can do it by setting a temporary threshold. The temporary threshold can be set anywhere in command run and live until a command ends.

```
/** @var \SimpleAsFuck\PerformanceLog\Service\PerformanceLogConfig $performanceLogConfig */

$performanceLogConfig->setSlowCommandThreshold(60); // one minute

// run some measured logic

// no need for threshold restoring, performance listener will handle it
```

### Job

[](#job)

If you want to overwrite global threshold configuration, you can set a temporary threshold. The temporary threshold can be set anywhere in job run and live until a job ends.

```
/** @var \SimpleAsFuck\PerformanceLog\Service\PerformanceLogConfig $performanceLogConfig */

$performanceLogConfig->setSlowJobThreshold(10000); // 10 seconds

// run some measured logic

// no need for threshold restoring, performance listener will handle it
```

Usage with monitoring
---------------------

[](#usage-with-monitoring)

Is recommended send performance warning logs into your monitoring system, so you know what is slow.

For simple monitoring is [sentry](https://docs.sentry.io/platforms/php/) integration. Sentry integration can collect information about request or command with stacktrace, this can make finding slow query much easier.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance80

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Total

4

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dcf2ca03f52f05685f62127eaeb513e84856c4cbbdc728fb0eb99d6e659a7a37?d=identicon)[Triplkrypl](/maintainers/Triplkrypl)

---

Top Contributors

[![Triplkrypl](https://avatars.githubusercontent.com/u/15320684?v=4)](https://github.com/Triplkrypl "Triplkrypl (85 commits)")

---

Tags

logperformancephpsimple

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/simple-as-fuck-php-performance-log/health.svg)

```
[![Health](https://phpackages.com/badges/simple-as-fuck-php-performance-log/health.svg)](https://phpackages.com/packages/simple-as-fuck-php-performance-log)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M106](/packages/laravel-cashier)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[spatie/laravel-export

Create a static site bundle from a Laravel app

646127.9k5](/packages/spatie-laravel-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
