PHPackages                             v-dem/queasy-log - 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. v-dem/queasy-log

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

v-dem/queasy-log
================

Logger classes (currently supports file system, console and simple email logging), part of QuEasy PHP Framework

1.1.0(1y ago)1404[7 issues](https://github.com/v-dem/queasy-log/issues)LGPL-3.0-onlyPHPPHP &gt;=5.3.0|&gt;=7.0.0

Since Aug 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/v-dem/queasy-log)[ Packagist](https://packagist.org/packages/v-dem/queasy-log)[ Docs](https://github.com/v-dem/queasy-log/)[ RSS](/packages/v-dem-queasy-log/feed)WikiDiscussions master Synced 2mo ago

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

[![Codacy Badge](https://camo.githubusercontent.com/97126cbbb44cb0dc61579e324a625889e017a95b79489f9773aec796a161bae7/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6337363733373231666630363462313039666661356431663466613932383031)](https://app.codacy.com/manual/v-dem/queasy-log?utm_source=github.com&utm_medium=referral&utm_content=v-dem/queasy-log&utm_campaign=Badge_Grade_Dashboard)[![codecov](https://camo.githubusercontent.com/50e312b508afee8945d2d723820c550f95582804ba4f632e4844187bccb21f1c/68747470733a2f2f636f6465636f762e696f2f67682f762d64656d2f7175656173792d6c6f672f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/v-dem/queasy-log)[![Total Downloads](https://camo.githubusercontent.com/6f288f7c179f5f6aadb6f15c7f641f781b74314e33d69822007ff629532c9339/68747470733a2f2f706f7365722e707567782e6f72672f762d64656d2f7175656173792d6c6f672f646f776e6c6f616473)](https://packagist.org/packages/v-dem/queasy-log)[![Latest Stable Version](https://camo.githubusercontent.com/0600e0a96a44799ad396aa46684278ab48fb2ea6796f7ce493dffa6403868183/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f762d64656d2f7175656173792d6c6f67)](https://packagist.org/packages/v-dem/queasy-log)[![License](https://camo.githubusercontent.com/cd0525e38f1b7d7f82171f7146bf1229c9bdb4db6e611190b8bfd4c751e64ec0/68747470733a2f2f706f7365722e707567782e6f72672f762d64656d2f7175656173792d6c6f672f6c6963656e7365)](https://packagist.org/packages/v-dem/queasy-log)

[QuEasy PHP Framework](https://github.com/v-dem/queasy-framework/) - Logger
===========================================================================

[](#queasy-php-framework---logger)

Package `v-dem/queasy-log`
--------------------------

[](#package-v-demqueasy-log)

Contains logger classes compatible with [PSR-3](https://www.php-fig.org/psr/psr-3/) logger interface. Currently file system and console loggers are implemented. This package includes these types of logging:

- Logger (base class, can be used as a container for other loggers)
- FileSystemLogger
- ConsoleLogger (supports ANSI color codes)
- SimpleMailLogger (encapsulates `mail()` function)

### Features

[](#features)

- PSR-3 compatible.
- Easy to use.
- Easy to extend.
- Nested loggers support.
- Configurable output message format.

### Requirements

[](#requirements)

- PHP version 5.3 or higher

### Documentation

[](#documentation)

See our [Wiki page](https://github.com/v-dem/queasy-log/wiki).

### Installation

[](#installation)

```
composer require v-dem/queasy-log:master-dev

```

### Usage

[](#usage)

Let's imagine we have the following `config.php`:

```
return [
    'logger' => [
        'class' => queasy\log\FileSystemLogger::class, // Logger class
        'processName' => 'test', // Process name, to differentiate log messages from different sources
        'minLevel' => Psr\Log\LogLevel::WARNING, // Message's minimum acceptable log level
        'path' => 'debug.log' // Path to logger output file
    ]
];
```

#### Creating logger instance

[](#creating-logger-instance)

Include Composer autoloader:

```
require_once('vendor/autoload.php');
```

Create config instance (using [`v-dem/queasy-config`](https://github.com/v-dem/queasy-config/) package):

```
$config = new queasy\config\Config('config.php');
```

Or using arrays:

```
$config = include('config.php');
```

Create logger instance (in this case `class` option can be omitted and will be ignored):

```
$logger = new queasy\log\Logger($config);
```

Another way to create logger instance (it will create an instance of `$config->logger->class`, by default `queasy\log\Logger`as an aggregate logger will be used):

```
$logger = queasy\log\Logger::create($config);
```

> `FileSystemLogger` and `ConsoleLogger` have default settings and can be used without config. Default log file path for `FileSystemLogger` is `debug.log`, default min log level is `Psr\Log\LogLevel::DEBUG` and max is `LogLevel::EMERGENCY`.

#### Writing messages to log

[](#writing-messages-to-log)

Output warning message:

```
$logger->warning('Test warning message.');
```

In `debug.log` you'll see something like this:

```
2017-12-24 16:13:09.302334 EET test [] [] [WARNING] Test warning message.

```

#### Chain log messages

[](#chain-log-messages)

```
$logger
    ->warning('going strange')
    ->error('cannot connect to the database')
    ->emergency('the website is down');
```

#### Using composite/nested loggers

[](#using-compositenested-loggers)

`config.php`:

```
return [
    [
        'class' => queasy\log\FileSystemLogger::class,
        'path' => 'debug.full.log',
        'minLevel' => Psr\Log\LogLevel::DEBUG,
        [
            'class' => queasy\log\ConsoleLogger::class,
            'minLevel' => Psr\Log\LogLevel::INFO
        ], [
            'class' => queasy\log\SimpleMailLogger::class,
            'minLevel' => Psr\Log\LogLevel::ALERT,
            'mailTo' => 'john.doe@example.com',
            'subject' => 'Website Alert'
        ]
    ], [
        'class' => queasy\log\FileSystemLogger::class,
        'path' => 'debug.log',
        'minLevel' => Psr\Log\LogLevel::INFO
    ]
];
```

Usage:

```
$config = new queasy\config\Config('config.php');
$logger = new queasy\log\Logger($config);
$logger->info('Hello, world!');
```

#### Using date/time in log file name (note "%s" there, it will be replaced by current date and/or time formatted as described in `timeLabel`)

[](#using-datetime-in-log-file-name-note-s-there-it-will-be-replaced-by-current-date-andor-time-formatted-as-described-in-timelabel)

`config.php`:

```
return [
    [
        'class' => queasy\log\FileSystemLogger::class,
        'path' => 'debug-full.%s.log',
        'timeLabel' => 'Y-m-d',
        'minLevel' => Psr\Log\LogLevel::DEBUG
    ]
];
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance23

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.9% 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 ~1270 days

Total

2

Last Release

458d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1413537?v=4)[Virginia Department of Emergency Management](/maintainers/vdem)[@vdem](https://github.com/vdem)

---

Top Contributors

[![v-dem](https://avatars.githubusercontent.com/u/6298430?v=4)](https://github.com/v-dem "v-dem (111 commits)")[![Compolomus](https://avatars.githubusercontent.com/u/10777258?v=4)](https://github.com/Compolomus "Compolomus (5 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")

---

Tags

logloggerloggingnested-loggersphppsr-3logpsr-3phplogginglogger

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/v-dem-queasy-log/health.svg)

```
[![Health](https://phpackages.com/badges/v-dem-queasy-log/health.svg)](https://phpackages.com/packages/v-dem-queasy-log)
```

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

511.0M18](/packages/apix-log)[markrogoyski/simplelog-php

Powerful PSR-3 logging. So easy, it's simple.

2818.1k4](/packages/markrogoyski-simplelog-php)[atrapalo/monolog-elasticsearch

A Monolog handler and formatter that makes use of the elasticsearch/elasticsearch package

1123.0k](/packages/atrapalo-monolog-elasticsearch)

PHPackages © 2026

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