casbin / psr3-bridge
This library provides a PSR-3 compliant bridge for Casbin Logger.
Installs: 219 763
Dependents: 15
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 2
Open Issues: 0
Requires
- casbin/casbin: ^2.0|^3.0
- psr/log: ^1.1|^2.0|^3.0
Requires (Dev)
- mockery/mockery: ^1.2
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ~7.0|~8.0
README
This library provides a PSR-3 compliant bridge for PHP-Casbin
Logger.
Casbin is a powerful and efficient open-source access control library.
Installation
Via Composer.
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.
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
License
This project is licensed under the Apache 2.0 license.