Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/amphp/log

Non-blocking logging for PHP based on Amp and Monolog.
https://github.com/amphp/log

amphp logging php psr-3

Last synced: 3 months ago
JSON representation

Non-blocking logging for PHP based on Amp and Monolog.

Awesome Lists containing this project

README

        

# amphp/log

AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind.
`amphp/log` provides a non-blocking stream handler for `monolog/monolog`.

[![Release](https://img.shields.io/github/release/amphp/log.svg?style=flat-square)](https://github.com/amphp/log/releases)
![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)

## Installation

This package can be installed as a [Composer](https://getcomposer.org/) dependency.

```bash
composer require amphp/log
```

## Usage

```php
setFormatter(new ConsoleFormatter);

$logger = new Logger('main');
$logger->pushHandler($handler);

$logger->debug("Hello, world!");
$logger->info("Hello, world!");
$logger->notice("Hello, world!");
$logger->error("Hello, world!");
$logger->alert("Hello, world!");
```