diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f5b1fa..f7901b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog][keepachangelog] and this project adher ### Added - gRPC client support +- Integrate with RoadRunner Logger ## Unreleased diff --git a/README.md b/README.md index abbb585..0c7c0d5 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ This package provides complete Laravel integration with RoadRunner, offering: - [gRPC Client](#grpc-client) - [Temporal](#temporal) - [Custom Workers](#custom-workers) +- [Integrate with RoadRunner Logger](#integrate-with-roadrunner-logger) - [Support](#support) - [License](#license) @@ -399,6 +400,28 @@ return [ The key in the `workers` array should match the value of the `RR_MODE` environment variable set by the RoadRunner server for your plugin. +### Integrate with RoadRunner Logger + +You can set the RoadRunner RPC address in your `.env` file (or use the default `tcp://127.0.0.1:6001`): + +``` +RR_RPC=tcp://127.0.0.1:6001 +``` + +After that, you can use the logger in your Laravel application by specifying the `rr` channel: + +```php +logger('rr')->info('This is an info message'); +``` + +Or directly via the Log facade: + +```php +use Illuminate\Support\Facades\Log; + +Log::channel('rr')->error('An error occurred'); +``` + ## Support If you find this package helpful, please consider giving it a star on GitHub. diff --git a/composer.json b/composer.json index 35a0f59..6e7b9e3 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,8 @@ "spiral/roadrunner-worker": "^3.0", "temporal/sdk": "^2.0", "internal/dload": "^1.1", - "spiral/grpc-client": "^1.0.0-rc1" + "spiral/grpc-client": "^1.0.0-rc1", + "hungthai1401/laravel-roadrunner-logger": "^1.0" }, "require-dev": { "laravel/framework": "^12.0",