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

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

vagnercsouza/logger
===================

PHP client to save realtime logs to Logz.io

1.0(9y ago)324.7k↓50%4[1 issues](https://github.com/vagnercsouza/logger/issues)MITPHPPHP &gt;=5.6.4

Since Jan 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/vagnercsouza/logger)[ Packagist](https://packagist.org/packages/vagnercsouza/logger)[ RSS](/packages/vagnercsouza-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

PHP Logger
==========

[](#php-logger)

PHP library to send realtime logs to Logz.io, an ELK as a service.

### Installing

[](#installing)

Install with composer:

```
$ composer require vagnercsouza/logger
```

### Usage

[](#usage)

First of all, you need an account on Logz.io. Then, go to you profile settings and get your api key (token).

#### Configure

[](#configure)

To configure the library, you just need to get an instance of Logger and set the api key. You need to do it once:

```
\Logger\Logger::getInstance()->setApiKey('TOKEN_HERE');
```

You can eather set an application name to identify the logs if you have more than one app sending logs:

```
\Logger\Logger::getInstance()->setApplication('My App Name');
```

#### Sending logs

[](#sending-logs)

To send a log, you need to get an instance of Logger and use one of the following functions:

```
// Send an info log
\Logger\Logger::getInstance()->info('My info log');

// Send a warning log
\Logger\Logger::getInstance()->warning('My warning log');

// Send an error log
\Logger\Logger::getInstance()->error('My error log');

// Send a debug log
\Logger\Logger::getInstance()->debug('My debug log');
```

#### Sending multiple logs

[](#sending-multiple-logs)

By default, the log is delivered to Logz.io right after you call the info, warning, error or debug functions. If you need to deliver more than one log, you can enable the bulk option, which will wait until you call the send function to actually deliver the logs to Logz.io.

```
// Enable the bulk mode
\Logger\Logger::getInstance()->setBulk(true);

// Send as many logs as you want
\Logger\Logger::getInstance()->warning('My warning log');
\Logger\Logger::getInstance()->error('My error log');
\Logger\Logger::getInstance()->warning('My second warning log');

// Finally, deliver the logs to Logz.io
\Logger\Logger::getInstance()->send();
```

#### Sending parameters

[](#sending-parameters)

If you need to send parameters with the log, you just need to pass an array as second parameter of the logs functions:

```
// Send an info log
\Logger\Logger::getInstance()->info('My info log', ['user' => 1213]);

// Send a warning log
\Logger\Logger::getInstance()->warning('My warning log', ['foo' => 'bar']);

// Send an error log
\Logger\Logger::getInstance()->error('My error log', ['line' => 18]);

// Send a debug log
\Logger\Logger::getInstance()->debug('My debug log', ['foo' => 'bar']);
```

### Contributing

[](#contributing)

To contribute, create a fork, make your changes, make tests, test and create a PR.

### License

[](#license)

This library is licenced under MIT.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3411d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6453240?v=4)[Vagner Cavalcante](/maintainers/vagnercsouza)[@vagnercsouza](https://github.com/vagnercsouza)

---

Top Contributors

[![vagnercsouza](https://avatars.githubusercontent.com/u/6453240?v=4)](https://github.com/vagnercsouza "vagnercsouza (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[marvinlabs/laravel-discord-logger

Logging to a discord channel in Laravel

2081.1M2](/packages/marvinlabs-laravel-discord-logger)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)

PHPackages © 2026

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