PHPackages                             tourze/backtrace-helper - 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. tourze/backtrace-helper

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

tourze/backtrace-helper
=======================

Backtrace helper

1.0.1(5mo ago)035.2k↓37.5%20MITPHPCI passing

Since Mar 25Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/backtrace-helper)[ Packagist](https://packagist.org/packages/tourze/backtrace-helper)[ RSS](/packages/tourze-backtrace-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (12)Used By (20)

Backtrace Helper
================

[](#backtrace-helper)

[English](README.md) | [中文](README.zh-CN.md)

\[[![Latest Version](https://camo.githubusercontent.com/4427cbdac77e34eae8262471f9a7ecf6a2cf17c2572bf0a8e1d049ec64d25c8a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/4427cbdac77e34eae8262471f9a7ecf6a2cf17c2572bf0a8e1d049ec64d25c8a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)\] () \[[![Total Downloads](https://camo.githubusercontent.com/bfe98f2ec35bb1d2aca8f1021e0222432028ef35f8dff3ead69d405db3fc743c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/bfe98f2ec35bb1d2aca8f1021e0222432028ef35f8dff3ead69d405db3fc743c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)\] () \[[![PHP Version](https://camo.githubusercontent.com/c95ecec1a56de59d8388975724cf2c0cf717b4a3385882494bf67d45446e4e43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/c95ecec1a56de59d8388975724cf2c0cf717b4a3385882494bf67d45446e4e43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)\] () \[[![License](https://camo.githubusercontent.com/16fe2135754b4eadc8f4d7c2af95fd6d5d68404c0a46e35431f1f63cc1aff1df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/16fe2135754b4eadc8f4d7c2af95fd6d5d68404c0a46e35431f1f63cc1aff1df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)\] () \[[![Code Coverage](https://camo.githubusercontent.com/eeda6afcf07b90188c05ee55566a931b581cbf477422e46137bca596c476e50e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/eeda6afcf07b90188c05ee55566a931b581cbf477422e46137bca596c476e50e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746f75727a652f6261636b74726163652d68656c7065722e7376673f7374796c653d666c61742d737175617265)\] ()

A PHP package for enhanced backtrace handling and exception printing with useful context information, built on top of Spatie's backtrace library.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
    - [Requirements](#requirements)
- [Quick Start](#quick-start)
    - [Basic Backtrace](#basic-backtrace)
    - [Exception Printing](#exception-printing)
    - [Context-Aware Exceptions](#context-aware-exceptions)
    - [Clean Proxy Class Names](#clean-proxy-class-names)
- [Advanced Usage](#advanced-usage)
    - [Custom Log Data](#custom-log-data)
    - [Production Environment Optimization](#production-environment-optimization)
    - [Integration with Logging](#integration-with-logging)
- [Testing](#testing)
- [Contributing](#contributing)
    - [Development Standards](#development-standards)
- [License](#license)

Features
--------

[](#features)

- **Enhanced Stack Traces**: Clean and readable stack trace formatting with intelligent frame filtering
- **Production-Ready**: Automatic filtering of irrelevant stack frames in production environments (autoload, vendor internals)
- **Exception Printing**: Rich exception formatting with method arguments, file locations, and context
- **Context-Aware Exceptions**: Support for exceptions with contextual data through interfaces and traits
- **Proxy Class Handling**: Clean formatting for AOP and Doctrine proxy class names
- **Zero Configuration**: Works out of the box with sensible defaults
- **PHP 8.1+ Support**: Modern PHP features and type safety

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

[](#installation)

```
composer require tourze/backtrace-helper
```

### Requirements

[](#requirements)

- PHP 8.1 or higher
- ext-mbstring
- spatie/backtrace ^1.7.1
- symfony/event-dispatcher ^6.4
- symfony/http-kernel ^6.4

Quick Start
-----------

[](#quick-start)

### Basic Backtrace

[](#basic-backtrace)

```
