Download the PHP package dschuppelius/php-error-toolkit without Composer

On this page you can find all versions of the php package dschuppelius/php-error-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-error-toolkit

PHP Error Toolkit

PHP Version PSR-3 Compliant License: MIT

A PSR-3 compliant logging library built for PHP 8.1+ with a focus on console and file logging. Designed as a lightweight, reusable component for modern PHP applications.

Features

Installation

Install via Composer:

Requirements

Quick Start

Basic Usage with Console Logger

File Logging

Using the ErrorLog Trait

Add logging capabilities to any class:

Logger Types

Console Logger

File Logger

Null Logger

Global Logger Registry

Manage loggers globally across your application:

Log Levels

Supports all PSR-3 log levels with integer-based filtering:

ErrorLog Trait Features

The ErrorLog trait provides comprehensive logging capabilities with multiple advanced features:

Magic Methods

All PSR-3 log levels are available as magic methods:

Hex Output for String Messages

For debugging encoding or binary transport issues, you can log a message with an additional hex representation:

Jedes Zeichen steht genau über seinem Hex-Code. Für Multibyte-Zeichen (z. B. ä → C3 A4) wird die Zeichenspalte entsprechend verbreitert:

You can also enable it on direct PSR-3 logger calls via context flag:

Conditional Logging

Log messages only when conditions are met:

Log with Timer

Measure execution time of operations:

Log and Return

Log a message and return a value in one call:

Log Exceptions

Log exceptions with full stack trace:

Log and Throw Exceptions

Combine logging and exception throwing in a single call with log{Level}AndThrow():

Available log-and-throw methods:

Method Log Level
logErrorAndThrow() ERROR
logCriticalAndThrow() CRITICAL
logAlertAndThrow() ALERT
logEmergencyAndThrow() EMERGENCY

Method signature:

Logger Management

The trait provides flexible logger management:

Automatic Project Detection

The trait automatically detects project names from class namespaces:

Fallback Logging System

When no logger is available, the trait provides intelligent fallbacks:

  1. Primary: Uses configured PSR-3 logger
  2. Fallback 1: PHP error_log() if configured
  3. Fallback 2: System syslog with project-specific facility
  4. Fallback 3: File logging to system temp directory

Context Support

All logging methods support PSR-3 context arrays:

Configuration

Log Level Filtering

File Logger Options

Testing

Run the test suite:

Or run PHPUnit directly:

Cross-Platform Terminal Support

The toolkit automatically detects:

Helper Classes

OsHelper

Cross-platform operating system detection and utilities:

TerminalHelper

Terminal detection and capabilities:

PhpUnitHelper

PHPUnit-specific utilities:

Architecture

License

MIT License. See LICENSE file for details.

Author

Daniel Jörg Schuppelius

Contributing

This is a personal toolkit for Daniel Schuppelius's projects. For bugs or feature requests, please open an issue.


All versions of php-error-toolkit with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1 <8.6
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dschuppelius/php-error-toolkit contains the following files

Loading the files please wait ...