PHPackages                             passchn/cakephp-logging - 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. passchn/cakephp-logging

ActiveCakephp-plugin[Logging &amp; Monitoring](/categories/logging)

passchn/cakephp-logging
=======================

Logging plugin for CakePHP

0.1.0(1y ago)013MITPHPPHP ^8.2

Since Aug 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/passchn/cakephp-logging)[ Packagist](https://packagist.org/packages/passchn/cakephp-logging)[ RSS](/packages/passchn-cakephp-logging/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Logging plugin for CakePHP
==========================

[](#logging-plugin-for-cakephp)

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

```
composer require passchn/cakephp-logging
```

Load the plugin:

```
bin/cake plugin load Passchn/CakeLogging
```

Usage
-----

[](#usage)

The plugin enables you to configure the Cake Log class to use implementations of the PSR-3 logger interface which are available in your Applications container.

It comes with a MultiLogger where you can define multiple implementations as fallbacks.

Configuration
-------------

[](#configuration)

In your `config/app.php` you can configure the logger like this:

```
return [
    'Log' => [
        'debug' => [
            'className' => LoggerFacade::class, // use the facade to configure the actual logger
            LoggerFacade::CONFIG_KEY_UNDERLYING_LOGGER => MyLoggerImplementation::class, // a LoggerInterface implementation
        ],
    ],
];
```

Note that `MyLoggerImplementation` must be available in your container.

### MultiLogger usage

[](#multilogger-usage)

You can also use the MultiLogger to define multiple fallbacks:

```
return [

    // default config for the multi logger
    MultiLoggerConfig::class => [
        MultiLoggerConfig::CONFIG_KEY_LOGGERS => [
            SentryLogger::class,
            FileLog::class,
        ],
    ],

    'Log' => [
        'debug' => [
            'className' => LoggerFacade::class,
            LoggerFacade::CONFIG_KEY_UNDERLYING_LOGGER => MultiLogger::class,
            MultiLoggerConfig::class => [
                // multi logger config can be overridden here
                MultiLoggerConfig::CONFIG_KEY_LOGGERS => [
                    MyLoggerImplementation::class,
                    AnotherLoggerImplementation::class,
                    FileLog::class, // the default file logger as fallback
                ],
            ],
            'path' => LOGS,
            'file' => 'debug',
            'url' => env('LOG_DEBUG_URL', null),
            'scopes' => null,
            'levels' => ['notice', 'info', 'debug'],
        ],

        'error' => [
            // ...
        ],

        'emergency' => [
            'className' => FileLog::class,
            'className' => LoggerFacade::class,
            LoggerFacade::CONFIG_KEY_UNDERLYING_LOGGER => MultiLogger::class,
            MultiLoggerConfig::CONFIG_KEY_LOGGERS => [
                SmsEmergencyLogger::class,
                AlexaTextToSpeechAlarmWithWaterSprinklerLogger::class,
            ],
        ],
    ],
];
```

If you use the default FileLogger, leave the config keys as they are as they will be used for the FileLog configuration.

Every logger used by the multi logger must be an implementation of the LoggerInterface which is available in your container.

### Configuring custom loggers

[](#configuring-custom-loggers)

If you want to configure a custom logger, you can do so by implementing the `LoggerInterface` and adding it to your container.

```
use Psr\Log\LoggerInterface;

class MyLoggerImplementation extends \Psr\Log\AbstractLogger implements LoggerInterface
{
    public function __construct(
        private readonly SomeDependency $dependency,
    ) {
        // ...
    }

    public function log($level, $message, array $context = [])
    {
        // your implementation
    }
}
```

Then, you can add it to your container.

In your Application.php:

```
public function services(ContainerInterface $container): void
{
    $container->add(
        MyLoggerImplementation::class,
        fn () => new MyLoggerImplementation(
            $container->get(SomeDependency::class),
        ),
    );
}
```

Then, you can just use the implementation by adding the class name in your app.php configuration for the respective logging scope:

```
MultiLoggerConfig::CONFIG_KEY_LOGGERS => [
    MyLoggerImplementation::class,
    ...
],
```

Learn more about Dependency Injection in the [CakePHP Book](https://book.cakephp.org/5/en/development/dependency-injection.html).

Collaboration
-------------

[](#collaboration)

If you have any ideas or encounter a bug, feel free to open an issue or a pull request.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

638d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77938819?v=4)[Pascal Schneider](/maintainers/passchn)[@passchn](https://github.com/passchn)

---

Top Contributors

[![passchn](https://avatars.githubusercontent.com/u/77938819?v=4)](https://github.com/passchn "passchn (20 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/passchn-cakephp-logging/health.svg)

```
[![Health](https://phpackages.com/badges/passchn-cakephp-logging/health.svg)](https://phpackages.com/packages/passchn-cakephp-logging)
```

###  Alternatives

[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[illuminate/log

The Illuminate Log package.

6224.3M518](/packages/illuminate-log)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2222.9M248](/packages/open-telemetry-sdk)[open-telemetry/api

API for OpenTelemetry PHP.

1833.0M214](/packages/open-telemetry-api)[pagemachine/typo3-formlog

Form log for TYPO3

23225.3k6](/packages/pagemachine-typo3-formlog)

PHPackages © 2026

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