Skip to content

esatisfaction/betterstack-logs

 
 

Repository files navigation

Monolog handler for Better Stack Logs

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'),
        'handler'        => \Goedemiddag\BetterStackLogs\BetterStackHandler::class,
        'handler_with'   => [
            'sourceToken' => env('BETTERSTACK_LOGS_SOURCE_TOKEN'),
            'endpoint' => env('BETTERSTACK_ENDPOINT'),
        ],
    ],
    ...
]   

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_ENDPOINT=your-endpoint

About

This package allows you to write logs to Better Stack Logs

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%