{"id":19133928,"url":"https://github.com/rummykhan/xlog","last_synced_at":"2026-05-17T03:09:28.582Z","repository":{"id":57047601,"uuid":"66096233","full_name":"rummykhan/xlog","owner":"rummykhan","description":"A Package to log requests laravel, exceptions and responses.","archived":false,"fork":false,"pushed_at":"2017-08-30T12:53:52.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T17:47:11.816Z","etag":null,"topics":["exceptions","laravel","logging","requests"],"latest_commit_sha":null,"homepage":"http://rehanmanzoor.me/","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/rummykhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-19T16:25:25.000Z","updated_at":"2017-03-20T10:14:14.000Z","dependencies_parsed_at":"2022-08-23T17:50:22.886Z","dependency_job_id":null,"html_url":"https://github.com/rummykhan/xlog","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/rummykhan/xlog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rummykhan%2Fxlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rummykhan%2Fxlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rummykhan%2Fxlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rummykhan%2Fxlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rummykhan","download_url":"https://codeload.github.com/rummykhan/xlog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rummykhan%2Fxlog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284145006,"owners_count":26954846,"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","status":"online","status_checked_at":"2025-11-13T02:00:06.582Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["exceptions","laravel","logging","requests"],"created_at":"2024-11-09T06:24:25.446Z","updated_at":"2025-11-13T03:03:43.672Z","avatar_url":"https://github.com/rummykhan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"X-Log\n=====\n\n[![Latest Stable Version](https://img.shields.io/badge/packagist-V%203.0.0-blue.svg)](https://packagist.org/packages/rummykhan/xlog)\n\nA PHP/Laravel Package to log all the requests, with the exceptions, country and city. It will help you get insight of your visitors activiy. Built on top of `torann/geoip` and `jenssegers/agent`\n\nInstallation\n------------\n\nInstall using composer:\n\n```bash\ncomposer require rummykhan/xlog\n```\n\nAdd Service Providers\n---------------------\n\nAdd these two service provider in `app/config/app.php`:\n\n```php\n\\Torann\\GeoIP\\GeoIPServiceProvider::class,\nRummyKhan\\XLog\\XLogServiceProvider::class,\n```\n\nPublish Configuration\n---------------------\n\nPublish the configuration using command:\n\n```bash\nphp artisan vendor:publish\n```\n\nUpdate geoip database\n---------------------\n\nUpdate geoip database using command:\n\n```bash\nphp artisan geoip:update\n```\n\nAdd Middleware\n--------------\nAdd `XLogMiddleWare` to your `app\\Http\\Kernel.php` as a web middleware group:\n\n```php\n\\RummyKhan\\XLog\\Http\\Middleware\\XLogMiddleware::class,\n```\n\nMigrate Log Table ( You don't have to migrate if your database is mongodb.)\n---------------------------------------------------------------------------\nMigrate Log Table migration:\n\n```bash\nphp artisan migrate\n```\n\n Configure your application logging behavior\n--------------------------------------------\n\nThe `php artisan vendor:publish` will publish `Log table migration` into migrations folder, `geoip.php` and `xlog.php` in config folder of you laravel installation.\n\n#### Logging Environments\n\nIn `xlog.php` you may specify your `igonore_environments` as an array, In these environment it will not log any request or response e.g.\n\n```php\n'ignore_environments' =\u003e ['local', 'test'],\n```\n\n#### Set Database Type\n\nIn `xlog.php` you may specify your `db_type` as string. Since laravel supported databases (mysql, sqlite, pgsql) behaves differently than laravel not supported databases, For that purpose I'm using a `ProxyModel` Which switch the `Eloquent Mode` based on database type.\nE.g. For any laravel supported database you can leave it blank, For mongodb you can set it to 'mongo'.\n\n```php\n'db_type' =\u003e 'mongodb'\n```\nSupported database types are (sqlite, mysql, pgsql, mongodb).\n\n#### DB Connection\n\nIn `xlog.php` you may specify your `connection` as string. This connection will be used to save the logs. (By default it uses application connection)\n```php\n'connection' =\u003e env('DB_CONNECTION')\n```\nSupported database types are (sqlite, mysql, pgsql, mongodb).\n\n#### DB Table\nIn `xlog.php` you may specify the table_name for you logs.\n```php\n'table' =\u003e 'logs'\n```\n\n#### Log Display Routes\nIn `xlog.php` you may specify your `routes`. For now there are only three routes. \n1. Index: where you can see the logs in tabular format using laravel pagination.\n2. Detail: Where you can see the logs detail.\n3. Delete: You can delete a log.\n    \n( You may specify you own routes and controllers in case you want to. All you have to do is Call the RummyKhan\\XLog\\Models\\Log Model to get the logs.)\n```php\n'routes' =\u003e [\n    'index'  =\u003e [ 'route' =\u003e '/admin/logs',      'action' =\u003e 'XLogController@index'],        // HTTP Method is GET\n    'detail' =\u003e [ 'route' =\u003e '/admin/logs/{id}', 'action' =\u003e 'XLogController@detail'],       // HTTP Method is GET\n    'delete' =\u003e [ 'route' =\u003e '/admin/logs/{id}', 'action' =\u003e 'XLogController@delete']        // HTTP Method is DELETE\n],\n```\nWhen changing routes, don't change the wildcard `{id}` from the routes.\n\n#### Log Middleware\nIn `xlog.php` you can specify the middleware for you log routes. By default middleware is set to auth.\n```php\n'middleware' =\u003e ['auth']\n```\n\n## MIT Liscense\nLaravel rummykhan/xlog is licensed under [The MIT License (MIT)](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frummykhan%2Fxlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frummykhan%2Fxlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frummykhan%2Fxlog/lists"}