keldorde / laravel-api-logger
An API logger channel that can be used to send Log messages to an API endpoint.
Installs: 296
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/keldorde/laravel-api-logger
Requires
- php: ^8.4
- laravel/framework: ^11.0|^12.0
- monolog/monolog: ^3.0
README
An API logger channel that can be used to send Log messages to an API endpoint.
Usage
-
Export the API logger configuration file
php artisan vendor:publish --provider="KeldorDE\ApiLogger\ApiLoggerServiceProvider" --tag="config" -
Add the following array element to the
channelsarray inconfig/logging.php'api' => [ 'driver' => 'custom', 'via' => \KeldorDE\ApiLogger\Logger\ApiLogChannel::class, ], -
Configure the environment variables
LOG_CHANNEL=stack
LOG_STACK=api
LOG_API_ENDPOINT=https://api.example.com/logs/create
LOG_API_TOKEN=some-api-token
LOG_API_USER_AGENT=Some/UserAgent
Environment variables
See the config/api-logger.php file for detailed descriptions.