Helps logging multiple and possibly asynchronously running processes

1.0.0 2022-03-10 07:31 UTC

This package is auto-updated.

Last update: 2024-06-10 12:30:14 UTC


PHP from Packagist Codacy Badge Total Downloads License

Bit&Black Process Log.

Helps logging multiple and possibly asynchronously running processes by writing and reading their statuses in files.


This library is made for the use with Composer. Add it to your project by running $ composer require bitandblack/process-log.


1. Set up and update a process

Set up a process writer with a unique id and a folder where all the processes can be stored:


use BitAndBlack\ProcessLog\ProcessWriter;

$processWriter = new ProcessWriter(

Create a status object and tell it something:


use BitAndBlack\ProcessLog\Status\Message;

$status = new Message('Here is my status');

You can also create a progress bar. Set it up with the total count of steps:


use BitAndBlack\ProcessLog\Status\Bar;

$status = new Bar(100);

For each step in your action store the status with the process writer:


foreach ($myAction as $step) {
    /** Do something here... */

If you have a progress bar you can update the count by calling $status->advance().

At the end clear the process:



2. Watch all processes

To watch the status of your processes you need to use the ProcessWatcher. Set it up with the folder of your processes and with an output object.

The output object needs to implement the Symfony\Component\Console\Output\OutputInterface.


use BitAndBlack\ProcessLog\ProcessWatcher;

$processWatcher = new ProcessWatcher(

After that, define in which interval you want to refresh the status output, define a initial wait time and start the watcher then.

The time is in microseconds here:



The watcher will run as long as there are files inside you processes folders and quit after that.


If you have any questions, feel free to contact us under

Further information about Bit&Black can be found under