PHPackages                             phalcon/incubator-logger - 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. [Framework](/categories/framework)
4. /
5. phalcon/incubator-logger

ActiveLibrary[Framework](/categories/framework)

phalcon/incubator-logger
========================

Phalcon Incubator Logger Adapters and Formatters

v2.0.0(2y ago)980.0k↓19%8[1 PRs](https://github.com/phalcon/incubator-logger/pulls)BSD-3-ClausePHPPHP &gt;=7.4CI failing

Since Jul 23Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/phalcon/incubator-logger)[ Packagist](https://packagist.org/packages/phalcon/incubator-logger)[ Docs](https://phalcon.io)[ GitHub Sponsors](https://github.com/phalcon)[ Fund](https://opencollective.com/phalcon)[ RSS](/packages/phalcon-incubator-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (8)Versions (8)Used By (0)

Phalcon\\Incubator\\Logger
==========================

[](#phalconincubatorlogger)

[![Discord](https://camo.githubusercontent.com/28c6fc95b5decf0e67719a5438501589c00b2db2b15228e67479d6548bbc9f6b/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3331303931303438383135323337353239373f6c6162656c3d446973636f7264)](http://phalcon.io/discord)[![Packagist Version](https://camo.githubusercontent.com/b6ef51f5e818b33b2ef3c15162287f7223cd32700961564b88c10fefa4fdebd9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068616c636f6e2f696e63756261746f722d6c6f67676572)](https://packagist.org/packages/phalcon/incubator-logger)[![PHP from Packagist](https://camo.githubusercontent.com/d3f6b0e3c8da959a3c5db5466eaabefa7d8d0f5b5d178724c053c5fe523073cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068616c636f6e2f696e63756261746f722d6c6f67676572)](https://packagist.org/packages/phalcon/incubator-logger)[![codecov](https://camo.githubusercontent.com/75db85d8990a9e705711fa433a5c2ed43d2a9b8ac5ec74a3e9538d741473048f/68747470733a2f2f636f6465636f762e696f2f67682f7068616c636f6e2f696e63756261746f722d6c6f676765722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/phalcon/incubator-logger)[![Packagist](https://camo.githubusercontent.com/7e37a846a2e00d5793cc37bb4f3f270cedabdb3e7549c7fa799ffc4e40922e6e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f7068616c636f6e2f696e63756261746f722d6c6f67676572)](https://packagist.org/packages/phalcon/incubator-logger/stats)

Extra Adapters for Phalcon Logger component.

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

[](#installation)

```
composer require phalcon/incubator-logger

```

Amazon CloudWatch
-----------------

[](#amazon-cloudwatch)

Adapter to store logs in AWS CloudWatch:

Note: group name and stream name must be created before call any logs. You can make it inside AWS console.

```
use Aws\CloudWatchLogs\CloudWatchLogsClient;
use Phalcon\Incubator\Logger\Adapter\CloudWatch;
use Phalcon\Logger\Logger;

$di->set(
    'logger',
    function () {
        $client = new CloudWatchLogsClient([
            'credentials' => [
                'key' => 'AMAZON_CLOUDWATCH_KEY',
                'secret' => 'AMAZON_CLOUDWATCH_SECRET',
            ],
            'region' => 'AMAZON_CLOUDWATCH_REGION',
            'version' => 'latest', // Or any specific
        ]);

        $adapter = new CloudWatch($client, '/group/name', 'stream-name');

        return new Logger('messages', ['main' => $adapter]);
    }
);
```

Database
--------

[](#database)

Adapter to store logs in a database table:

```
use Phalcon\Db\Adapter\Pdo\Mysql;
use Phalcon\Incubator\Logger\Adapter\Database as DbLogger;

$di->set(
    'logger',
    function () {
        $connection = new Mysql(
            [
                'host'     => 'localhost',
                'username' => 'root',
                'password' => 'secret',
                'dbname'   => 'audit',
            ]
        );

        $logsName  = 'errors';
        $tableName = 'logs';

        return new DbLogger($connection, $logsName, $tableName);
    }
);
```

The following table used to store the logs:

```
CREATE TABLE IF NOT EXISTS `logs` (
  `id` INT(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(32) DEFAULT NULL,
  `type` INT(3) NOT NULL,
  `content` text,
  `created_at` BIGINT unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
```

UDP logger
----------

[](#udp-logger)

Adapter to send messages by UDP protocol to external server

```
use Phalcon\Incubator\Logger\Adapter\Udp as UdpLogger;

$di->set(
    'logger',
    function () {
        $host = '192.168.1.2';
        $port = 65000;

        return new UdpLogger('errors', $host, $port);
    }
);
```

Slack logger
------------

[](#slack-logger)

Adapter to write messages into a Slack channel

[![slack-log](.assets/slack-log.png)](.assets/slack-log.png)

```
$adapter = new \Phalcon\Incubator\Logger\Adapter\Slack('api-token','channel-name');

$logger = new \Phalcon\Logger\Logger('logger-name', ['main-slack' => $adapter]);
$logger->info('Information message to log in the channel channel-name');
```

### Creating an application in Slack API

[](#creating-an-application-in-slack-api)

Access this [page](https://api.slack.com/apps) to create an `application` (after choosing/creating a workspace)

### Giving rights to post messages

[](#giving-rights-to-post-messages)

Go to `Features > OAuth & Permissions` and in the `Scopes` section -&gt; `Add an oauth scope` and select the following rights :

- chat:write
- chat:write.public

### Get the token

[](#get-the-token)

You can now generate a token for your bot/user in the `Install App` section which looks something like this :

```
xoxp-1111111-22222222-33333333-aaaaaaaaaaaaaaaaaaaaaa

```

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance53

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 61.7% 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 ~217 days

Recently: every ~269 days

Total

6

Last Release

1040d ago

Major Versions

v1.0.1 → v2.x-dev2021-10-10

v1.0.2 → v2.0.02023-07-13

PHP version history (2 changes)v1.0.0-beta.1PHP &gt;=7.2

v2.0.0PHP &gt;=7.4

### Community

Maintainers

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

---

Top Contributors

[![Jeckerson](https://avatars.githubusercontent.com/u/3289702?v=4)](https://github.com/Jeckerson "Jeckerson (58 commits)")[![rayanlevert](https://avatars.githubusercontent.com/u/78140431?v=4)](https://github.com/rayanlevert "rayanlevert (25 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![niden](https://avatars.githubusercontent.com/u/1073784?v=4)](https://github.com/niden "niden (2 commits)")[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (1 commits)")

---

Tags

cloudwatch-logsdatabaseloggermonologphalconphp-librarypsr-3udp-socketpsr-3frameworkawsloggerphalconmonologincubatorlog formatter

###  Code Quality

TestsCodeception

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phalcon-incubator-logger/health.svg)

```
[![Health](https://phpackages.com/badges/phalcon-incubator-logger/health.svg)](https://phpackages.com/packages/phalcon-incubator-logger)
```

###  Alternatives

[phalcon/incubator

Adapters, prototypes or functionality that can be potentially incorporated to the C-framework.

7222.9M81](/packages/phalcon-incubator)[phalcon/devtools

This tools provide you useful scripts to generate code helping to develop faster and easy applications that use with Phalcon framework.

1.3k2.0M54](/packages/phalcon-devtools)[yiisoft/log

Yii Logging Library

42917.2k26](/packages/yiisoft-log)[phalcon/incubator-mailer

Phalcon Incubator Mailer Adapters

1318.1k2](/packages/phalcon-incubator-mailer)[projek-xyz/slim-monolog

Write log file on your Slim 3 application with Monolog logger.

1117.0k1](/packages/projek-xyz-slim-monolog)

PHPackages © 2026

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