Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/richpeers/laravel-log-oauth2-curl
Custom Laravel Log driver
https://github.com/richpeers/laravel-log-oauth2-curl
curl laravel monolog oauth2
Last synced: about 1 month ago
JSON representation
Custom Laravel Log driver
- Host: GitHub
- URL: https://github.com/richpeers/laravel-log-oauth2-curl
- Owner: richpeers
- License: mit
- Created: 2018-12-31T20:02:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-01T03:04:27.000Z (almost 6 years ago)
- Last Synced: 2024-04-20T19:25:11.609Z (8 months ago)
- Topics: curl, laravel, monolog, oauth2
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel Log OAuth2 cURL
[![Latest Stable Version](https://poser.pugx.org/richpeers/laravel-log-oauth2-curl/v/stable)](https://packagist.org/packages/richpeers/laravel-log-oauth2-curl)
[![Total Downloads](https://poser.pugx.org/richpeers/laravel-log-oauth2-curl/downloads)](https://packagist.org/packages/richpeers/laravel-log-oauth2-curl)
[![Latest Unstable Version](https://poser.pugx.org/richpeers/laravel-log-oauth2-curl/v/unstable)](https://packagist.org/packages/richpeers/laravel-log-oauth2-curl)
[![License](https://poser.pugx.org/richpeers/laravel-log-oauth2-curl/license)](https://packagist.org/packages/richpeers/laravel-log-oauth2-curl)Custom Log driver for Laravel **5.6** || **5.7**
Queued and posted via cURL, authorised with (cached) Client Credentials Grant Token.
This package is intended as a client to a server, for recording logs. Useful where you have multiple projects and might have one or more instances. For example develop, test or staging.
## Server requirement
Two endpoints are required at your log server. These are defaults and can be changed in config.
- `/oauth/token` [Passport](https://laravel.com/docs/5.7/passport)'s default route for granting token response to **client_id** and **client_secret**.
- `/api/logger` POST the logs.## Installation
Install with composer. The package will automatically register itself.
```
composer require richpeers/laravel-log-oauth2-curl
```Add environment specific variables. Get the **client_id** and **client_secret** credentials from your log server.
```
LOG_SERVER_HOST=https://your-server.base-url.com
LOG_SERVER_CLIENT_ID=
LOG_SERVER_CLIENT_SECRET=
```Add the following to the *channels* array in your **/config/logging.php** file.
```
'logserver' => ['driver' => 'logserver']
```Set default log channel in **.env** ( Or add channel to stack array in /config/logging.php )
```
LOG_CHANNEL=logserver
```Optionally run this command to copy **logserver.php** to /config, to modify it.
```
php artisan vendor:publish --tag=logserver
```## Queue Driver
As the package queues the logs before being authenticated and posted to the log server, using something like redis as your queue driver will mean a faster response for the user if there is an error.