PHPackages                             fivesqrd/central - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. fivesqrd/central

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

fivesqrd/central
================

Central job logging library for multi server implementations

1.2.5(1y ago)0387PHPPHP &gt;=5.4.0

Since Jun 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Five-Squared/Central)[ Packagist](https://packagist.org/packages/fivesqrd/central)[ RSS](/packages/fivesqrd-central/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (13)Used By (0)

Central
=======

[](#central)

Central log for console scripts

```
composer require fivesqrd/central:1.2.*

```

Setup
-----

[](#setup)

Using AWS SDK

```
$config = [
    'namespace' => 'My-App-Name',
    'adapter'   => 'Aws',
    'options'   => [ // Adapter specific options
        'table'     => null,
        'client'    => new Aws\DynamoDb\DynamoDbClient($aws),
        'marshaler' => new Aws\DynamoDb\Marshaler()
    ],
];

```

Using the Bego library

```
$db = new Bego\Database(
    new Aws\DynamoDb\DynamoDbClient($config), new Aws\DynamoDb\Marshaler()
);

$config = [
    'namespace' => 'My-App-Name',
    'adapter'   => 'Bego',
    'options'   => [ // Adapter specific options
        'client'    => $db->table(new App\MyTables\Logs()),
    ],
];

```

With Laravel 5 Setup is automatically done in Laravel

Basic Example
-------------

[](#basic-example)

```
use Fivesqrd\Central;

$job = Central\Factory::job($config);

$job->instance('MyScriptName')->start(function($log) {

     //do something here

     $log->debug('Something was done');

     return 'Everything was done ok';
});

/* Store log for 30 days */
$job->save(strtotime('+ 30 days'));

/* Get the job status */
echo $job->status();

```

Executing inside a class
------------------------

[](#executing-inside-a-class)

```
use Fivesqrd\Central;

$job = Central\Factory::job($config)
    ->instance(self::class)
    ->start(array($this, '_execute'))
    ->save(strtotime('+ 30 days'));

```

Realtime debug output
---------------------

[](#realtime-debug-output)

```
/* Output debug info to stdout as well */
print_r($job->log()->toArray());

/* Output the same log entry saved to storage */
print_r($job->record());

```

Atomic locking
--------------

[](#atomic-locking)

```
use Fivesqrd\Central;

$job = Central\Factory::job($config)
    ->instance(self::class)
    ->lock()
    ->start(self::class, array($this, '_execute'))
    ->save(strtotime('+ 30 days'));

```

Laravel 5
---------

[](#laravel-5)

.env requirements

```
CENTRAL_TABLE="My-Table"
CENTRAL_ADAPTER="Aws"
CENTRAL_NAMESPACE="My-App"

AWS_KEY="my-key"
AWS_SECRET="my-secret"
AWS_REGION="eu-west-1"
AWS_ENDPOINT=

```

Using it in a command class:

```
    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $job = resolve('central')
            ->instance(self::class)
            ->start(array($this, '_execute'))
            ->save(strtotime('+ 30 days'));

        /* logic here */
        $this->info("Command completed with: {$job->status()}");;
    }

    protected function _execute($log)
    {
        $log->debug('Job started at ' . date('Y-m-d H:i:s'));
        return 'It worked';
    }

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~246 days

Recently: every ~593 days

Total

12

Last Release

548d ago

Major Versions

0.3.0 → 1.0.x-dev2018-04-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/7326f7193078067ab21d775e45c06241d8cc03548c6c3191146d840f2e8277ba?d=identicon)[christianjburger](/maintainers/christianjburger)

---

Top Contributors

[![christianjburger](https://avatars.githubusercontent.com/u/43279?v=4)](https://github.com/christianjburger "christianjburger (57 commits)")

### Embed Badge

![Health badge](/badges/fivesqrd-central/health.svg)

```
[![Health](https://phpackages.com/badges/fivesqrd-central/health.svg)](https://phpackages.com/packages/fivesqrd-central)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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