Download the PHP package antlerops/error-logger without Composer

On this page you can find all versions of the php package antlerops/error-logger. 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 error-logger

Antler Error Logger

An advanced PHP error logging system with comprehensive context capture, multiple transport options, and robust error handling for PHP 7.1+ and PHP 8.0+ applications.

Features

Installation

Basic Usage

Configuration Options

Config Key Default Value Description
project_hash null Required: Unique project identifier
remote_endpoint null Remote logging API URL (Required for remote logging)
log_file_path ./logs/application.log Path to local log file
request_timeout 2 Timeout in seconds for remote requests
min_log_level LogLevel::WARNING Minimum severity level to log (DEBUG to CRITICAL)
use_remote_logging true Enable/disable remote logging
use_file_logging true Enable/disable local file logging
use_error_log true Use PHP error_log() for ERROR+ levels
rate_limit_per_minute 60 Maximum allowed logs per minute to prevent flooding
sampling_rate 1.0 Sampling rate for logs (0.0 to 1.0)
circuit_breaker_threshold 0 Errors per minute to trigger circuit breaker (0=disabled)
circuit_breaker_cooldown 60 Seconds to keep circuit breaker open
async_processing false Send logs asynchronously (non-blocking)

Environment Variables

All configuration options can be set via environment variables:

Configuration in code overrides environment variables.

Enhanced Stack Traces with Code Context

One of the powerful features of Antler Error Logger is the ability to capture detailed code context around errors. This makes debugging easier by showing you exactly what was happening in your code when the error occurred:

This will include the enhanced stack trace with source code context in your logs.

Log Levels

The logger offers five standard severity levels:

Contextual Tagging

Tags allow you to categorize log entries for easier filtering and analysis.

Log Entry and Request Tracking

Each log entry now includes a unique ID, and logs from the same request are linked with a request ID:

Performance Instrumentation

Track execution time and memory usage:

Nested Context Support

Maintain a context stack throughout code execution:

Sampling and Circuit Breaker

Reduce log volume in high-traffic scenarios:

Log Filtering

Filter out unwanted log entries:

Asynchronous Processing

Process logs without blocking application execution:

Automatic Context Capture

The logger automatically captures different information depending on the execution environment:

Common to Both CLI and Web

CLI-Specific Context

Web-Specific Context

Data Privacy and Sanitization

The logger automatically redacts sensitive information from request data. Fields containing the following strings will be redacted:

For example:

Remote Payload Example

Here's an example of what the logger sends to remote endpoints, including the enhanced stack trace:

Advanced Configuration Examples

Development Environment

High-Traffic Production Environment

CLI Application Example

Laravel Integration

Antler Error Logger integrates easily with Laravel applications thanks to its singleton pattern. This section covers how to use the error logger directly in Laravel without additional facades or service providers.

Supported Laravel Versions

Antler Error Logger is compatible with the following Laravel versions:

Laravel Version PHP Compatibility Support Status
Laravel 6.x PHP 7.2 or higher ✓ Supported
Laravel 7.x PHP 7.2.5 or higher ✓ Supported
Laravel 8.x PHP 7.3 or higher ✓ Supported
Laravel 9.x PHP 8.0.2 or higher ✓ Supported
Laravel 10.x PHP 8.1 or higher ✓ Supported
Laravel 11.x PHP 8.2 or higher ✓ Supported
Laravel 12.x PHP 8.2 or higher ✓ Supported

Note: For PHP 7.1 compatibility, you must use Laravel 5.8 or earlier. Laravel 6.0+ requires PHP 7.2+.

Simple Installation

  1. Install the package via Composer:

  2. That's it! No service providers or facades required.

Basic Usage in Laravel

Since the Antler Error Logger uses a singleton pattern, you can access it directly in your Laravel application:

Recommended Setup in Laravel

Bootstrap Integration

A clean way to integrate the logger is by initializing it in a service provider. You can use Laravel's AppServiceProvider or create a dedicated provider:

Then register this provider in your config/app.php:

Integrating with Laravel's Exception Handler

To capture all exceptions in your Laravel application, you can modify your exception handler:

Troubleshooting

Remote Logging Not Working

  1. Check connectivity to your remote endpoint:

  2. Verify your PHP installation has required extensions:

  3. Check for PHP warnings in your error log about cURL or stream requests.

File Logging Issues

  1. Check directory permissions:

  2. Create the log directory manually and set proper permissions:

PHP Error Handler Integration

The logger automatically registers handlers for:

These handlers capture detailed information about errors, including the enhanced stack traces with code context, and send them through all configured transports.

Remote Payload Changes

The logger now includes the following additional fields in the remote payload:

These additions are backward compatible with existing remote endpoints, as they only add new fields without modifying or removing existing ones.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Requirements


All versions of error-logger with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1 || ^8.0
ext-curl Version *
ext-json Version *
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 antlerops/error-logger contains the following files

Loading the files please wait ....