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.6.3(3w ago)01.9k1UnlicensePHPPHP ^8.2CI passing

Since Aug 30Pushed 1w 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.6 Synced 2w ago

READMEChangelog (10)Dependencies (92)Versions (15)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)

ToolsHttp server requestsHttp client requestsDB transactionsSQL queriesConsole commandsQueue Jobs[Laravel](https://laravel.com/docs)With middleware use, default 1 secondGuzzle with handler stack build by Laravel, default 700 millisecondsDefault 300 millisecondsDefault 50 millisecondsDefault offRecommended 40 seconds[Guzzle](https://docs.guzzlephp.org)UnsupportedWith middleware use, default 700 millisecondsUnsupportedUnsupportedUnsupportedUnsupported### 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 server request time logging you must register [LaravelMiddleware](../src/Middleware/LaravelMiddleware.php)as global on **first position**.

### Application with Guzzle

[](#application-with-guzzle)

For http client request time logging you must register [GuzzleMiddleware](../src/Middleware/GuzzleMiddleware.php)to your guzzle instance.

### 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 server 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 server 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 client

[](#http-client)

If you know that some webservice is slow or some your microservice dependency should be extra fast, you can overwrite global threshold configuration by setting a temporary threshold.

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

$requestThreshold = $performanceLogConfig->setSlowClientRequestThreshold(null);

// call http requests by your client

$requestThreshold->restore();
```

### Http server

[](#http-server)

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 and multiple times in request run last set take effect and live until a request ends.

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

$performanceLogConfig->setSlowServerRequestThreshold(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 and multiple times in command run last set take effect 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 and multiple times in job run last set take effect 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

46

—

FairBetter than 92% of packages

Maintenance97

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

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 ~25 days

Recently: every ~1 days

Total

14

Last Release

21d 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 (108 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

[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[laravel/pulse

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

1.7k16.3M154](/packages/laravel-pulse)[laravel/cashier

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

2.6k31.8M162](/packages/laravel-cashier)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9922.4M146](/packages/roots-acorn)[flarum/core

Delightfully simple forum software.

211.5M2.5k](/packages/flarum-core)

PHPackages © 2026

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