PHPackages                             logtrace/logtrace-php - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. logtrace/logtrace-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

logtrace/logtrace-php
=====================

PHP client for the Logtrace API

v0.0.2(1mo ago)40MITPHPPHP &gt;=8.1

Since Jun 4Pushed 1mo agoCompare

[ Source](https://github.com/logtracehq/logtrace-php)[ Packagist](https://packagist.org/packages/logtrace/logtrace-php)[ RSS](/packages/logtrace-logtrace-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

logtrace-php
============

[](#logtrace-php)

PHP client for the Logtrace API. Requires PHP ≥ 8.1.

Install
-------

[](#install)

```
composer require logtrace/logtrace-php
```

Usage
-----

[](#usage)

```
use Logtrace\Client;
use Logtrace\CreateEventRequest;

$client = new Client(getenv('LOGTRACE_API_KEY'));

$client->createEvent(new CreateEventRequest(
    name:      'user.signup',
    user_id:          '123',
    metadata:        ['plan' => 'pro'],
));

$client->createSession(new CreateSessionRequest(...));
$client->createAuditLog(new CreateAuditLogRequest(...));
```

PSR-15 middleware
-----------------

[](#psr-15-middleware)

Automatically attaches request context (IP, method, endpoint, headers, status code) to every call made inside a handler.

```
use Logtrace\Middleware;

$app->add(new Middleware($client));
```

Inside any handler:

```
$rc = $request->getAttribute(Middleware::ATTRIBUTE);

$rc->createEvent(new CreateEventRequest(
    name: 'order.placed',
    // ...
));
```

Error handling
--------------

[](#error-handling)

```
use Logtrace\LogtraceException;

try {
    $client->createEvent($req);
} catch (LogtraceException $e) {
    echo $e->statusCode; // HTTP status
    echo $e->getMessage();
}
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance92

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

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

Total

2

Last Release

42d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/686850516717f1d729499127ce51afd36c0b5ed06245efec7a1255e64926dc0c?d=identicon)[luigimorel](/maintainers/luigimorel)

---

Top Contributors

[![luigimorel](https://avatars.githubusercontent.com/u/48476293?v=4)](https://github.com/luigimorel "luigimorel (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/logtrace-logtrace-php/health.svg)

```
[![Health](https://phpackages.com/badges/logtrace-logtrace-php/health.svg)](https://phpackages.com/packages/logtrace-logtrace-php)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25026.1M82](/packages/php-http-cache-plugin)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k122](/packages/httpsoft-http-message)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)[swoft/websocket-server

swoft websocket server component

16135.7k5](/packages/swoft-websocket-server)[thesis/nats

Async (fiber based) client for Nats.

754.4k](/packages/thesis-nats)[jasny/http-signature

Implementation of the IETF HTTP Signatures draft RFC

10104.7k](/packages/jasny-http-signature)

PHPackages © 2026

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