2017 © Pedro Peláez
 

library xlog

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

image

rummykhan/xlog

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

  • Wednesday, August 30, 2017
  • by rummykhan
  • Repository
  • 2 Watchers
  • 0 Stars
  • 88 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 16 Versions
  • 0 % Grown

The README.md

X-Log

Latest Stable Version, (*1)

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, (*2)

Installation

Install using composer:, (*3)

composer require rummykhan/xlog

Add Service Providers

Add these two service provider in app/config/app.php:, (*4)

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

Publish Configuration

Publish the configuration using command:, (*5)

php artisan vendor:publish

Update geoip database

Update geoip database using command:, (*6)

php artisan geoip:update

Add Middleware

Add XLogMiddleWare to your app\Http\Kernel.php as a web middleware group:, (*7)

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

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

Migrate Log Table migration:, (*8)

php artisan migrate

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., (*9)

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., (*10)

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

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'., (*11)

'db_type' => 'mongodb'

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

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), (*13)

'connection' => env('DB_CONNECTION')

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

DB Table

In xlog.php you may specify the table_name for you logs., (*15)

'table' => 'logs'

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., (*16)

( 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.), (*17)

'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., (*18)

Log Middleware

In xlog.php you can specify the middleware for you log routes. By default middleware is set to auth., (*19)

'middleware' => ['auth']

MIT Liscense

Laravel rummykhan/xlog is licensed under The MIT License (MIT)., (*20)

The Versions

30/08 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

30/08 2017

3.1.1

3.1.1.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

30/08 2017

3.1.0

3.1.0.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

26/04 2017

3.0.4

3.0.4.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

07/01 2017

dev-develop

dev-develop

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

07/01 2017

3.0.3

3.0.3.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

07/01 2017

3.0.2

3.0.2.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

07/01 2017

3.0.1

3.0.1.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

07/01 2017

3.0.0

3.0.0.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

07/01 2017

2.0.3

2.0.3.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

07/01 2017

2.0.2

2.0.2.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

07/01 2017

2.0.1

2.0.1.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

07/01 2017

2.0.0

2.0.0.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

27/08 2016

1.0.2

1.0.2.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

19/08 2016

1.0.1

1.0.1.0

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

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor

19/08 2016

1.0.0

1.0.0.0

Log requests coming to your website.

  Sources   Download

MIT

The Requires

 

by Rehan Manzoor