{"id":13563889,"url":"https://github.com/aungwinthant/apilogger","last_synced_at":"2026-01-11T08:59:42.591Z","repository":{"id":35125003,"uuid":"209861521","full_name":"aungwinthant/apilogger","owner":"aungwinthant","description":"Small laravel package for viewing api logs which can be used in debugging.","archived":false,"fork":false,"pushed_at":"2022-10-02T08:13:55.000Z","size":126,"stargazers_count":348,"open_issues_count":19,"forks_count":61,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-06T22:48:24.464Z","etag":null,"topics":["api","laravel","logger"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aungwinthant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-20T18:58:36.000Z","updated_at":"2025-02-26T12:26:32.000Z","dependencies_parsed_at":"2022-08-17T21:30:33.247Z","dependency_job_id":null,"html_url":"https://github.com/aungwinthant/apilogger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aungwinthant%2Fapilogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aungwinthant%2Fapilogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aungwinthant%2Fapilogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aungwinthant%2Fapilogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aungwinthant","download_url":"https://codeload.github.com/aungwinthant/apilogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247075123,"owners_count":20879389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","laravel","logger"],"created_at":"2024-08-01T13:01:24.286Z","updated_at":"2026-01-11T08:59:42.549Z","avatar_url":"https://github.com/aungwinthant.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# API Logger\n\nThis is a small package that can helps in debugging api logs. It can log \nrequest method, url, duration, request payload, which models are retrieved, controller and method. \n\n![screenshot](screenshot.png)\n\n##  Installation\n\n1. Install the package via composer\n\n```bash\ncomposer require awt/apilogger @dev\n```\n## Usage\n\n1.  Laravel 5.5 and higher uses Package Auto-Discovery, so doesn't require you to manually add\nthe ServiceProvider. If you use a lower version of Laravel you must register it in your \n_app.php_ file:\n\n```bash\nAWT\\Providers\\ApiLogServiceProvider::class\n```\n\n2. Publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=config --provider=\"AWT\\Providers\\ApiLogServiceProvider\"\n```\n\nThe config file is called *apilogs.php*. Currently supported drivers are *db* and *file*\n\nBy default the logger will use *file* to log the data. But if you want to use Database for logging, migrate table by using\n\nYou can also configure which fields should not be logged like passwords, secrets, etc.\n\n***You dont need to migrate if you are just using file driver***\n\n```bash\nphp artisan migrate\n```\n\n3. Add middleware named ***apilogger*** to the route or controller you want to log data\n\n```php\n//in route.php or web.php\nRoute::middleware('apilogger')-\u003epost('/test',function(){\n    return response()-\u003ejson(\"test\");\n});\n```\n\n4. Dashboard can be accessible via ***yourdomain.com/apilogs***\n\n## Clear the logs\n\nYou can permenently clear the logs by using the following command.\n```bash\nphp artisan apilog:clear\n```\n## Implement your own log driver\n\n1. Your driver class ***must*** implement ApiLoggerInterface for saving, retrieving and deleting the logs.\n2. Your driver class may extends `AbstractLogger` class which provide helpful methods such as logData and mapArrayToModel.\n3. Substitude in your new class name instead of `db` or `file` as the driver. eg: `\\App\\Apilogs\\CustomLogger::class`\n\n## Security\n### Add Auth\nIn config/apilog.php you have 'route' option, you can change the prefix and add auth middleware or any other middleware\n```php\n'route'          =\u003e [\n    'prefix'     =\u003e 'apilogs',\n    'middleware' =\u003e null,//Can be change to ['auth'] or others\n]\n```\n\n\nIf you discover any security related issues, please email agwinthant@gmail.com instead of using the issue tracker.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faungwinthant%2Fapilogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faungwinthant%2Fapilogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faungwinthant%2Fapilogger/lists"}