https://github.com/roadrunner-php/app-logger
🔌 Application logger plugin
https://github.com/roadrunner-php/app-logger
logger monolog php roadrunner
Last synced: 2 days ago
JSON representation
🔌 Application logger plugin
- Host: GitHub
- URL: https://github.com/roadrunner-php/app-logger
- Owner: roadrunner-php
- License: mit
- Created: 2022-10-31T10:00:58.000Z (almost 3 years ago)
- Default Branch: 1.x
- Last Pushed: 2024-08-13T08:10:55.000Z (about 1 year ago)
- Last Synced: 2025-09-18T02:52:53.448Z (23 days ago)
- Topics: logger, monolog, php, roadrunner
- Language: PHP
- Homepage:
- Size: 29.3 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Package for sending log messages to RoadRunner
[](https://packagist.org/packages/roadrunner-php/app-logger)
[](https://packagist.org/packages/roadrunner-php/app-logger)
[](https://github.com/roadrunner-php/app-logger/actions)
[](https://github.com/roadrunner-php/app-logger/actions)
[](https://codecov.io/gh/roadrunner-php/app-logger/)
[](https://packagist.org/packages/roadrunner-php/app-logger)## Requirements
Make sure that your server is configured with following PHP version and extensions:
- PHP 8.1+
## Installation
You can install the package via composer:
```bash
composer require roadrunner-php/app-logger
```## Usage
Such a configuration would be quite feasible to run:
```yaml
rpc:
listen: tcp://127.0.0.1:6001logs:
channels:
app:
level: info
```Then you need to create an instance of `RoadRunner\Logger\Logger`
```PHP
use Spiral\Goridge\RPC\RPC;
use RoadRunner\Logger\Logger;$rpc = RPC::create('tcp://127.0.0.1:6001');
// or
$rpc = RPC::fromGlobals();
// or
$rpc = RPC::fromEnvironment(new \Spiral\RoadRunner\Environment([
'RR_RPC' => 'tcp://127.0.0.1:6001'
]));$logger = new Logger($rpc);
```## Available methods
```debug```, ```error```, ```info```, ```warning``` is RoadRunner logger, and ```log``` is stderr
```PHP
/**
* debug mapped to RR's debug logger
*/
$logger->debug('Debug message');/**
* error mapped to RR's error logger
*/
$logger->error('Error message');/**
* log mapped to RR's stderr
*/
$logger->log("Log message \n");/**
* info mapped to RR's info logger
*/
$logger->info('Info message');/**
* warning mapped to RR's warning logger
*/
$logger->warning('Warning message');
```## License
The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained
by [Spiral Scout](https://spiralscout.com).