PHPackages                             rummykhan/xlog - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. rummykhan/xlog

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

rummykhan/xlog
==============

A PHP Laravel package to log all the requests coming to your website

3.1.1(8y ago)01071MITPHP

Since Aug 19Pushed 8y ago2 watchersCompare

[ Source](https://github.com/rummykhan/xlog)[ Packagist](https://packagist.org/packages/rummykhan/xlog)[ RSS](/packages/rummykhan-xlog/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (4)Versions (16)Used By (0)

X-Log
=====

[](#x-log)

[![Latest Stable Version](https://camo.githubusercontent.com/29d7413a176832c4d91293f3f47528af53fb52a6837b6e31d2b2c12c6229c526/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d56253230332e302e302d626c75652e737667)](https://packagist.org/packages/rummykhan/xlog)

A 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`

Installation
------------

[](#installation)

Install using composer:

```
composer require rummykhan/xlog
```

Add Service Providers
---------------------

[](#add-service-providers)

Add these two service provider in `app/config/app.php`:

```
\Torann\GeoIP\GeoIPServiceProvider::class,
RummyKhan\XLog\XLogServiceProvider::class,
```

Publish Configuration
---------------------

[](#publish-configuration)

Publish the configuration using command:

```
php artisan vendor:publish
```

Update geoip database
---------------------

[](#update-geoip-database)

Update geoip database using command:

```
php artisan geoip:update
```

Add Middleware
--------------

[](#add-middleware)

Add `XLogMiddleWare` to your `app\Http\Kernel.php` as a web middleware group:

```
\RummyKhan\XLog\Http\Middleware\XLogMiddleware::class,
```

Migrate Log Table ( You don't have to migrate if your database is mongodb.)
---------------------------------------------------------------------------

[](#migrate-log-table--you-dont-have-to-migrate-if-your-database-is-mongodb)

Migrate Log Table migration:

```
php artisan migrate
```

Configure your application logging behavior
-------------------------------------------

[](#configure-your-application-logging-behavior)

The `php artisan vendor:publish` will publish `Log table migration` into migrations folder, `geoip.php` and `xlog.php` in config folder of you laravel installation.

#### Logging Environments

[](#logging-environments)

In `xlog.php` you may specify your `igonore_environments` as an array, In these environment it will not log any request or response e.g.

```
'ignore_environments' => ['local', 'test'],
```

#### Set Database Type

[](#set-database-type)

In `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. E.g. For any laravel supported database you can leave it blank, For mongodb you can set it to 'mongo'.

```
'db_type' => 'mongodb'
```

Supported database types are (sqlite, mysql, pgsql, mongodb).

#### DB Connection

[](#db-connection)

In `xlog.php` you may specify your `connection` as string. This connection will be used to save the logs. (By default it uses application connection)

```
'connection' => env('DB_CONNECTION')
```

Supported database types are (sqlite, mysql, pgsql, mongodb).

#### DB Table

[](#db-table)

In `xlog.php` you may specify the table\_name for you logs.

```
'table' => 'logs'
```

#### Log Display Routes

[](#log-display-routes)

In `xlog.php` you may specify your `routes`. For now there are only three routes.

1. Index: where you can see the logs in tabular format using laravel pagination.
2. Detail: Where you can see the logs detail.
3. Delete: You can delete a log.

( 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.)

```
'routes' => [
    'index'  => [ 'route' => '/admin/logs',      'action' => 'XLogController@index'],        // HTTP Method is GET
    'detail' => [ 'route' => '/admin/logs/{id}', 'action' => 'XLogController@detail'],       // HTTP Method is GET
    'delete' => [ 'route' => '/admin/logs/{id}', 'action' => 'XLogController@delete']        // HTTP Method is DELETE
],
```

When changing routes, don't change the wildcard `{id}` from the routes.

#### Log Middleware

[](#log-middleware)

In `xlog.php` you can specify the middleware for you log routes. By default middleware is set to auth.

```
'middleware' => ['auth']
```

MIT Liscense
------------

[](#mit-liscense)

Laravel rummykhan/xlog is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~59 days

Total

14

Last Release

3226d ago

Major Versions

1.0.2 → 2.0.02017-01-07

2.0.3 → 3.0.02017-01-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12664104?v=4)[Rehan Manzoor](/maintainers/rummykhan)[@rummykhan](https://github.com/rummykhan)

---

Top Contributors

[![rummykhan](https://avatars.githubusercontent.com/u/12664104?v=4)](https://github.com/rummykhan "rummykhan (45 commits)")

---

Tags

exceptionslaravelloggingrequests

### Embed Badge

![Health badge](/badges/rummykhan-xlog/health.svg)

```
[![Health](https://phpackages.com/badges/rummykhan-xlog/health.svg)](https://phpackages.com/packages/rummykhan-xlog)
```

###  Alternatives

[open-telemetry/opentelemetry-auto-laravel

OpenTelemetry auto-instrumentation for Laravel

592.4M8](/packages/open-telemetry-opentelemetry-auto-laravel)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14844.4k1](/packages/guanguans-laravel-exception-notify)[laravel-enso/core

The backend shell of a Laravel Enso application

3464.9k201](/packages/laravel-enso-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
