PHPackages                             25th/behat-php-errorlog - 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. 25th/behat-php-errorlog

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

25th/behat-php-errorlog
=======================

08.4k1PHP

Since Nov 27Pushed 11y ago8 watchersCompare

[ Source](https://github.com/25th-floor/behat-php-errorlog)[ Packagist](https://packagist.org/packages/25th/behat-php-errorlog)[ RSS](/packages/25th-behat-php-errorlog/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

behat-php-errorlog
==================

[](#behat-php-errorlog)

PHP Error Logger Context for Behat 3.

The Context extends from Mink so you need a mink driver running. Basically it creates a log file for every Test Scenario in the beforeScenario Hook and after the Scenario it looks into the log file if there is something present.

To get Errors logged within these Error Log Files the application itself needs to be adjusted. This Context sends the necessary information to your application but the application itself needs to know what to do with it.

For this the application and the behat runner must be on the same machine, so both can access the same error log file.

Selenium
--------

[](#selenium)

Selenium does not provide a way to send such meta information via Headers or something else. The easiest way to get information to your application therefore is to call an url (which must be provided in the configuration of the context) with the necessary information and handle everything else within the application. (for example via cookie).

In our case, the Context will call the provided url with the full path to the error log file.

Installation
============

[](#installation)

Just install via composer

Configuration
=============

[](#configuration)

behat
-----

[](#behat)

Add the context to your behat confguration file. There are three Constructor Parameters:

- `directory` it needs the Directory where to put the log files.
- `url` optional but required for selenium test scenarios. See Selenium Part
- `size` optional, definition after which size it will no longer output the contents of the error log file to your output. Defaults to 2014, use 0 to disable it.

your application
----------------

[](#your-application)

Depending if it's a normal Scenario or Selenium you need to adjust your application to work with the context.

For Selenium Scenarios you have to provide the url and then save the error\_log, for example within a cookie. Other Scenarios will get the absolute path to the error log using the request Headser `X-BEHAT-PHP-ERROR-LOG`.

With the absolute path to the error log one must set the php configuration:

```
ini_set("log_errors", 1);
ini_set("error_log", $path);
```

Scenarios
---------

[](#scenarios)

You don't need to adjust anything in your Scenarios to get this working. But there is way if you don't want the Context to run at a specific Scenario or a whole Feature File. You can use the tag `@ignore-php-logging` if you don't want any php action to be logged.

Todo
====

[](#todo)

- Get Wep Api working
- maybe don't depend that behat and application are on the same machine?

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f819de39a6e7566165242b47d06b2c866572c80e4789d4d29bb6fd0b75b9824?d=identicon)[dready](/maintainers/dready)

![](https://www.gravatar.com/avatar/b712966d74076870f9952c31aff1dbb540bf5cd554458857325320d7a02dfd89?d=identicon)[adepretis](/maintainers/adepretis)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/25th-behat-php-errorlog/health.svg)

```
[![Health](https://phpackages.com/badges/25th-behat-php-errorlog/health.svg)](https://phpackages.com/packages/25th-behat-php-errorlog)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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