PHPackages                             femastudios/jtrace - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. femastudios/jtrace

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

femastudios/jtrace
==================

A PHP library to create Java-like stacktraces

v1.0.1(4y ago)01.3k↓74.4%GPL-3.0-onlyPHPPHP &gt;=7.3

Since Jun 30Pushed 4y ago2 watchersCompare

[ Source](https://github.com/femastudios/php-jtrace)[ Packagist](https://packagist.org/packages/femastudios/jtrace)[ RSS](/packages/femastudios-jtrace/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (3)Used By (0)

jtrace
======

[](#jtrace)

A PHP library to create Java-like stacktraces.

Installation through composer package `femastudios/jtrace`

Usage
-----

[](#usage)

```
// Create a JTrace class
$jtrace = JTrace::new();
// $e is a \Throwable instance
$jtrace->fromThrowable($e); // Returns the stacktrace as a string
$jtrace->printFromThrowable($e); // Prints the stacktrace
```

Sample output:

```
LogicException (0): Inner threw
    at C:\Users\username\Desktop\php\jtrace\tests\Code.php:16
    at C:\Users\username\Desktop\php\jtrace\tests\test.php:14->run()
    at C:\Users\username\Desktop\php\jtrace\tests\test.php:18

Caused by:
Exception (101): Inner message
    at C:\Users\username\Desktop\php\jtrace\tests\Code.php:9
    at C:\Users\username\Desktop\php\jtrace\tests\Code.php:14->runInner()
    at C:\Users\username\Desktop\php\jtrace\tests\test.php:14->run()
    at C:\Users\username\Desktop\php\jtrace\tests\test.php:18

```

Options
-------

[](#options)

Each `JTrace` instance can be customized with the following parameters:

- **Max items**: the maximum number of lines to print for each `\Throwable`. Defaults to `256`.
- **Max causes**: the maximum number of causes to print. Defaults to `64`.
- **Include arguments**: whether to include arguments of function calls in the stacktrace. Defaults to `false`.
    - **Include complex arguments**: whether to include non-trivial arguments in function calls. When `false` scalar types are written normally, for other types the type is written. When `true` an attempt to convert classes an arrays to string is made. Defaults to `false`.
    - **Arguments max length**: the maximum length for **all** the arguments for each line. When exceeded arguments are automatically separately shortened according to their size. Defaults to `1024`.

Example of customization:

```
JTrace::new()
    ->includeBaseArgs() // Includes only scalar args
    ->maxItems(null) // Removes the items limit
    ->maxCauses(8); // Limits the number of chained exceptions to 8
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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

Total

2

Last Release

1822d ago

PHP version history (2 changes)v1.0.0PHP ^7.3

v1.0.1PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/648242597974310b48d5146550fcce17701fdefb2ef9858bcd55ea8f439f79eb?d=identicon)[FEMAStudios](/maintainers/FEMAStudios)

---

Top Contributors

[![MMauro94](https://avatars.githubusercontent.com/u/21290655?v=4)](https://github.com/MMauro94 "MMauro94 (1 commits)")

### Embed Badge

![Health badge](/badges/femastudios-jtrace/health.svg)

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

###  Alternatives

[fjogeleit/prometheus-messenger-middleware

Prometheus Middleware for the Symfony Messenger Component

2255.2k](/packages/fjogeleit-prometheus-messenger-middleware)[spatie/craft-ray

Easily debug CraftCMS projects

1638.6k](/packages/spatie-craft-ray)

PHPackages © 2026

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