Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitexpert/slf4psrlog
Simple Logging Facade for Loggers implementing PSR-3 logging interface.
https://github.com/bitexpert/slf4psrlog
logging logging-facade php7 psr-3
Last synced: 3 months ago
JSON representation
Simple Logging Facade for Loggers implementing PSR-3 logging interface.
- Host: GitHub
- URL: https://github.com/bitexpert/slf4psrlog
- Owner: bitExpert
- License: apache-2.0
- Created: 2015-06-07T18:41:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T09:08:53.000Z (10 months ago)
- Last Synced: 2024-09-30T13:01:21.912Z (4 months ago)
- Topics: logging, logging-facade, php7, psr-3
- Language: PHP
- Homepage:
- Size: 108 KB
- Stars: 6
- Watchers: 13
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slf4psrlog
The Simple Logging Facade for PSR-3 loggers serves as a simple facade or abstraction for the various logging frameworks
implementing the PSR-3 logging standard. To achieve true interoperability, your own code should not depend on a specific
library implementing the PSR-3 logging standard.[![Build Status](https://travis-ci.org/bitExpert/slf4psrlog.svg?branch=master)](https://travis-ci.org/bitExpert/slf4psrlog)
[![Coverage Status](https://coveralls.io/repos/github/bitExpert/slf4psrlog/badge.svg?branch=master)](https://coveralls.io/github/bitExpert/slf4psrlog?branch=master)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/109408681246972700?domain=https://rheinneckar.social)](https://rheinneckar.social/@bitexpert)Installation
------------The preferred way of installing `bitexpert/slf4psrlog` is through Composer. Simply add `bitexpert/slf4psrlog` as a
dependency:```
composer.phar require bitexpert/slf4psrlog
```Example
-------Configure a callable to return a logger instance:
```php
\bitExpert\Slf4PsrLog\LoggerFactory::registerFactoryCallback(function($channel) {
// return configured PSR-3 logger instance
});
```In your classes create a logger instance by calling:
```php
$logger = \bitExpert\Slf4PsrLog\LoggerFactory::getLogger(__CLASS__);
```The \bitExpert\Slf4PsrLog\LoggerFactory will delegate the call to the callback function which needs to return an instance
of a PSR-3 logger.License
-------slf4psrlog is released under the Apache 2.0 license.