djiney/yii2-routes-logger

Yii Framework 2.0 Component routes logger

Installs: 937

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2018-12-21 10:23 UTC

This package is auto-updated.

Last update: 2024-04-21 22:17:15 UTC


README

Simple Yii2 extension to log all requested routes.

Installing

Composer installation

composer require djiney/yii2-routes-logger dev-master

Configuration

Migration

Just run base Yii2 migration with custom path

php yii migrate/up --migrationPath=@vendor/djiney/yii2-routes-logger/src/migrations/

Bootstrap

Add a configuration array to the bootstrap part of your application:

'bootstrap' => [
   ...
   [
      'class'  => 'djiney\routes\components\RoutesLogger',
      'filter' => 'djiney\routes\components\RoutesLoggerFilter'
   ],
   ...
],

If you use a "Yii2 Advanced Application", you can specify different settings to frontend and backend.

Filter is not necessary, but if you don't need too many logs - feel free to use the default one (which allows you to get rid of guest's routes logs), or just create your own.

The filter should implement RoutesLoggerFilterInterface.