All Projects → aungwinthant → Apilogger

aungwinthant / Apilogger

Licence: mit
Small laravel package for viewing api logs which can be used in debugging.

Projects that are alternatives of or similar to Apilogger

Saas Boilerplate
SaaS boilerplate built in Laravel, Bootstrap 4 and VueJs.
Stars: ✭ 152 (-46.67%)
Mutual labels:  api, laravel
Roastapp
Laravel学院 Roast 应用源码
Stars: ✭ 164 (-42.46%)
Mutual labels:  api, laravel
Deeply
PHP client for the DeepL.com translation API (unofficial)
Stars: ✭ 152 (-46.67%)
Mutual labels:  api, laravel
Laravel Fractal
An easy to use Fractal wrapper built for Laravel and Lumen applications
Stars: ✭ 1,748 (+513.33%)
Mutual labels:  api, laravel
Laravel Api Startup
"Laravel api startup" is a Laravel template project for start build an Api quickly and perfectly!
Stars: ✭ 184 (-35.44%)
Mutual labels:  api, laravel
Apiserver
基于Laravel的API服务端架构代码
Stars: ✭ 148 (-48.07%)
Mutual labels:  api, laravel
Restful Api With Laravel Definitive Guide
Repository with the base code for the course "RESTful API with Laravel - Definitive-Guide"
Stars: ✭ 156 (-45.26%)
Mutual labels:  api, laravel
Laravel Hackathon Starter
💻 A hackathon/MVP boilerplate for laravel web applications. Start your hackathons without hassle.
Stars: ✭ 1,589 (+457.54%)
Mutual labels:  api, laravel
Lumen Microservice
Lumen on Docker - Skeleton project with Nginx, MySQL & PHP 7 | Aws ECS, Google Kubernates, Azure Container Engine
Stars: ✭ 183 (-35.79%)
Mutual labels:  api, laravel
School Api
Laravel - MultiSchool - Admin (single)
Stars: ✭ 180 (-36.84%)
Mutual labels:  api, laravel
Laravel Api Explorer
API explorer for laravel applications
Stars: ✭ 138 (-51.58%)
Mutual labels:  api, laravel
Api Generator
PHP-code generator for Laravel framework, with complete support of JSON-API data format
Stars: ✭ 244 (-14.39%)
Mutual labels:  api, laravel
Laravel cities
Find any country/city in the world. Get Long/Lat etc. Deploy geonames.org database localy. Optimized DB tree
Stars: ✭ 133 (-53.33%)
Mutual labels:  api, laravel
Laravel Api Handler
Package providing helper functions for a Laravel REST-API
Stars: ✭ 150 (-47.37%)
Mutual labels:  api, laravel
Remove Bg
Programmatically remove backgrounds from your images using the remove.bg api
Stars: ✭ 124 (-56.49%)
Mutual labels:  api, laravel
Laravel Twitter Streaming Api
Easily work with the Twitter Streaming API in a Laravel app
Stars: ✭ 153 (-46.32%)
Mutual labels:  api, laravel
Wizard
Wizard是一款开源的文档管理工具,支持Markdown/Swagger/Table类型的文档。
Stars: ✭ 1,733 (+508.07%)
Mutual labels:  api, laravel
Api Response
Simple and ready to use API response wrapper for Laravel.
Stars: ✭ 123 (-56.84%)
Mutual labels:  api, laravel
Laravel Api Debugger
Easy debug for your JSON API.
Stars: ✭ 175 (-38.6%)
Mutual labels:  api, laravel
Jikan Rest
The REST API for Jikan
Stars: ✭ 200 (-29.82%)
Mutual labels:  api, laravel

API Logger

This is a small package that can helps in debugging api logs. It can log request method, url, duration, request payload, which models are retrieved, controller and method.

screenshot

Installation

  1. Install the package via composer
composer require awt/apilogger @dev

Usage

  1. Laravel 5.5 and higher uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider. If you use a lower version of Laravel you must register it in your app.php file:
AWT\Providers\ApiLogServiceProvider::class
  1. Publish the config file with:
php artisan vendor:publish --tag=config --provider="AWT\Providers\ApiLogServiceProvider"

The config file is called apilogs.php. Currently supported drivers are db and file

By default the logger will use file to log the data. But if you want to use Database for logging, migrate table by using

You can also configure which fields should not be logged like passwords, secrets, etc.

You dont need to migrate if you are just using file driver

php artisan migrate
  1. Add middleware named apilogger to the route or controller you want to log data
//in route.php or web.php
Route::middleware('apilogger')->post('/test',function(){
    return response()->json("test");
});
  1. Dashboard can be accessible via yourdomain.com/apilogs

Clear the logs

You can permenently clear the logs by using the following command.

php artisan apilog:clear

Implement your own log driver

  1. Your driver class must implement ApiLoggerInterface for saving, retrieving and deleting the logs.
  2. Your driver class may extends AbstractLogger class which provide helpful methods such as logData and mapArrayToModel.
  3. Substitude in your new class name instead of db or file as the driver. eg: \App\Apilogs\CustomLogger::class

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].