goedemiddag / betterstack-logs
Monolog handler for Better Stack Logs
v1.4.0
2026-08-14 09:31 UTC
Requires
- php: ^8.2
- ext-curl: *
- illuminate/config: ^10.0|^11.0|^12.0|^13.0
- illuminate/container: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- monolog/monolog: ^3.0
Requires (Dev)
- laravel/pint: ^1.16
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.5|^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This package allows you to write logs to Better Stack Logs.
Installation
First use composer to install the package using the following command
composer require goedemiddag/betterstack-logs
Usage
Add a new channel to the config/logging.php file
'channels' => [ ... 'betterstack' => [ 'driver' => 'monolog', 'level' => env('LOG_LEVEL', 'debug'), 'enabled' => env('BETTERSTACK_LOGS_ENABLED', true), 'handler' => \Goedemiddag\BetterStackLogs\BetterStackHandler::class, 'handler_with' => [ 'sourceToken' => env('BETTERSTACK_LOGS_SOURCE_TOKEN'), 'host' => env('BETTERSTACK_LOGS_HOST'), ], ], ... ]
Set the default log channel to betterstack or add it to the stack channel.
Add the following to your .env file:
BETTERSTACK_LOGS_SOURCE_TOKEN=your-source-token BETTERSTACK_LOGS_HOST=your-ingestion-host