https://github.com/php-casbin/psr3-bridge
This library provides a PSR-3 compliant bridge for Casbin Logger.
https://github.com/php-casbin/psr3-bridge
adapter bridge casbin logger permissions psr-3 rbac
Last synced: 7 months ago
JSON representation
This library provides a PSR-3 compliant bridge for Casbin Logger.
- Host: GitHub
- URL: https://github.com/php-casbin/psr3-bridge
- Owner: php-casbin
- License: apache-2.0
- Created: 2019-09-23T10:21:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-05T12:09:14.000Z (about 4 years ago)
- Last Synced: 2025-04-24T08:20:58.670Z (about 1 year ago)
- Topics: adapter, bridge, casbin, logger, permissions, psr-3, rbac
- Language: PHP
- Size: 12.7 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PSR-3 Bridge for PHP-Casbin Logger
[](https://travis-ci.org/php-casbin/psr3-bridge)
[](https://coveralls.io/github/php-casbin/psr3-bridge)
[](https://packagist.org/packages/casbin/psr3-bridge)
[](https://packagist.org/packages/casbin/psr3-bridge)
[](https://packagist.org/packages/casbin/psr3-bridge)
This library provides a PSR-3 compliant bridge for `PHP-Casbin` Logger.
[Casbin](https://github.com/php-casbin/php-casbin) is a powerful and efficient open-source access control library.
### Installation
Via [Composer](https://getcomposer.org/).
```
composer require casbin/psr3-bridge
```
### Usage
Here is an example of using `Monolog`, `Monolog` implements the PSR-3 interface.
You can use any other library that implements PSR-3 interface.
```php
use Casbin\Bridge\Logger\LoggerBridge;
use Casbin\Log\Log;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
$log = new Logger('name');
$log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
Log::setLogger(new LoggerBridge($log));
```
### Getting Help
- [php-casbin](https://github.com/php-casbin/php-casbin)
### License
This project is licensed under the [Apache 2.0 license](LICENSE).