PHPackages                             pnc-org/laravel-logger - 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. pnc-org/laravel-logger

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

pnc-org/laravel-logger
======================

Laravel Logger Package

0.0.13(4y ago)1298MITPHPPHP &gt;=7.3.0|^8.0

Since Apr 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/pnc-org/laravel-logger)[ Packagist](https://packagist.org/packages/pnc-org/laravel-logger)[ RSS](/packages/pnc-org-laravel-logger/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (3)Versions (14)Used By (0)

Laravel Activity Logger
=======================

[](#laravel-activity-logger)

Laravel logger is an activity event logger for your Laravel. It comes out the box with ready to use with dashboard to view your activity. Laravel logger can be added as a middleware or called through a trait. Easily have an Activity Log. This package is easily configurable and customizable. Supports Laravel 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6, and 7+

#### Table of contents

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Integrations](#integrations)
- [Laravel Installation Instructions](#laravel-installation-instructions)
- [Lumen Installation Instructions](#lumen-installation-instructions)
- [Configuration](#configuration)
    - [Environment File](#environment-file)
- [Usage](#usage)
    - [Authentication Middleware Usage](#authentication-middleware-usage)
    - [Trait Usage](#trait-usage)
- [Routes](#routes)
- [Search](#search)
- [Screenshots](#screenshots)
- [File Tree](#file-tree)
- [Opening an Issue](#opening-an-issue)
- [License](#license)

### Features

[](#features)

Laravel Activity Logger FeaturesLogs login page visitsLogs user loginsLogs user logoutsRouting Events can recording using middlewareRecords activity timestampsRecords activity descriptionRecords activity details (optional)Records activity user type with crawler detection.Records activity MethodRecords activity RouteRecords activity Ip AddressRecords activity User AgentRecords activity Browser LanguageRecords activity referrerCustomizable activity modelActivity panel dashboardIndividual activity drilldown report dashboardActivity Drilldown looks up Id Address meta informationActivity Drilldown shows user roles if enabledActivity Drilldown shows associated user eventsActivity log can be cleared, restored, and destroyed using eloquent softdeletesCleared activity logs can be viewed and have drilldown abilityUses font awesome, cdn assets can be optionally called in configurationUses [Geoplugin API](http://www.geoplugin.com/) for drilldown IP meta informationUses Language localization filesLots of [configuration](#configuration) options### Requirements

[](#requirements)

- [Laravel 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6, and 7+](https://laravel.com/docs/installation)
- [jaybizzle/laravel-crawler-detect](https://github.com/JayBizzle/Laravel-Crawler-Detect) included dependency in composer.json (for crawler detection)

### Integrations

[](#integrations)

Laravel logger can work out the box with or without the following roles packages:

- [jeremykenedy/laravel-roles](https://github.com/jeremykenedy/laravel-roles)
- [spatie/laravel-permission](https://github.com/spatie/laravel-permission)
- [Zizaco/entrust](https://github.com/Zizaco/entrust)
- [romanbican/roles](https://github.com/romanbican/roles)
- [ultraware/roles](https://github.com/ultraware/roles)

### Laravel Installation Instructions

[](#laravel-installation-instructions)

1. From your projects root folder in terminal run:

```
    composer require pnc-org/laravel-logger
```

2. Register the package

- Laravel 5.5 and up Uses package auto discovery feature, no need to edit the `config/app.php` file.
- Laravel 5.4 and below Register the package with laravel in `config/app.php` under `providers` with the following:

```
    'providers' => [
        Notus\LaravelLogger\LaravelLoggerServiceProvider::class,
    ];
```

3. Run the migration to add the table to record the activities to:

```
    php artisan migrate
```

- Note: If you want to specify a different table or connection make sure you update your `.env` file with the needed configuration variables.

4. Optionally Update your `.env` file and associated settings (see [Environment File](#environment-file) section)
5. Optionally publish the packages views, config file, assets, and language files by running the following from your projects root folder:

```
    php artisan vendor:publish --tag=LaravelLogger
```

### Lumen Installation Instructions

[](#lumen-installation-instructions)

### Configuration

[](#configuration)

Laravel Activity Logger can be configured in directly in `/config/laravel-logger.php` if you published the assets. Or you can variables to your `.env` file.

##### Environment File

[](#environment-file)

Here are the `.env` file variables available:

```
LARAVEL_LOGGER_DATABASE_CONNECTION=mysql
LARAVEL_LOGGER_DATABASE_TABLE=laravel_logger_activity
LARAVEL_LOGGER_ROLES_ENABLED=true
LARAVEL_LOGGER_ROLES_MIDDLWARE=role:admin
LARAVEL_LOGGER_MIDDLEWARE_ENABLED=true
LARAVEL_LOGGER_MIDDLEWARE_EXCEPT=
LARAVEL_LOGGER_ACTIVITY_MODEL=Notus\LaravelLogger\App\Models\Activity
LARAVEL_LOGGER_USER_MODEL=App\User
LARAVEL_LOGGER_USER_ID_FIELD=id
LARAVEL_LOGGER_DISABLE_ROUTES=false
LARAVEL_LOGGER_PAGINATION_ENABLED=true
LARAVEL_LOGGER_PAGINATION_PER_PAGE=25
LARAVEL_LOGGER_DATATABLES_ENABLED=true
LARAVEL_LOGGER_ENABLE_SEARCH=true
LARAVEL_LOGGER_SEARCH_FIELDS=description,user,method,route,ip
LARAVEL_LOGGER_DASHBOARD_MENU_ENABLED=true
LARAVEL_LOGGER_DASHBOARD_DRILLABLE=true
LARAVEL_LOGGER_LOG_RECORD_FAILURES_TO_FILE=true
LARAVEL_LOGGER_FLASH_MESSAGE_BLADE_ENABLED=true
LARAVEL_LOGGER_LAYOUT=layouts.app
LARAVEL_LOGGER_BOOTSTRAP_VERSION=4
LARAVEL_LOGGER_BLADE_PLACEMENT=stack                    #option: yield or stack
LARAVEL_LOGGER_BLADE_PLACEMENT_CSS=css-header           #placement name
LARAVEL_LOGGER_BLADE_PLACEMENT_JS=scripts-footer        #placement name
LARAVEL_LOGGER_JQUERY_CDN_ENABLED=true
LARAVEL_LOGGER_JQUERY_CDN_URL=https://code.jquery.com/jquery-2.2.4.min.js
LARAVEL_LOGGER_BOOTSTRAP_CSS_CDN_ENABLED=true
LARAVEL_LOGGER_BOOTSTRAP_CSS_CDN_URL=https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css
LARAVEL_LOGGER_BOOTSTRAP_JS_CDN_ENABLED=true
LARAVEL_LOGGER_BOOTSTRAP_JS_CDN_URL=https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js
LARAVEL_LOGGER_POPPER_JS_CDN_ENABLED=true
LARAVEL_LOGGER_POPPER_JS_CDN_URL=https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js
LARAVEL_LOGGER_FONT_AWESOME_CDN_ENABLED=true
LARAVEL_LOGGER_FONT_AWESOME_CDN_URL=https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css
```

### Usage

[](#usage)

##### Middleware Usage

[](#middleware-usage)

Events for laravel authentication scaffolding are listened for as providers and are enabled via middleware. You can add events to your routes and controllers via the middleware:

```
activity
```

Example to start recording page views using middlware in `web.php`:

```
Route::group(['middleware' => ['web', 'activity']], function () {
    Route::get('/', 'WelcomeController@welcome')->name('welcome');
});
```

This middlware can be enabled/disabled in the configuration settings.

##### Trait Usage

[](#trait-usage)

Events can be recorded directly by using the trait. When using the trait you can customize the event description.

To use the trait:

1. Include the call in the head of your class file:

    ```
        use Notus\LaravelLogger\App\Http\Traits\ActivityLogger;
    ```
2. Include the trait call in the opening of your class:

    ```
        use ActivityLogger;
    ```
3. You can record the activity my calling the traits method:

    ```
        ActivityLogger::activity("Logging this activity.");

    ```

    Or as bellow to include extended activity details:

    ```
        ActivityLogger::activity("Logging this activity.", "Additional activity details.");

    ```

### Routes

[](#routes)

##### Laravel Activity Dashbaord Routes

[](#laravel-activity-dashbaord-routes)

- `/activity`
- `/activity/cleared`
- `/activity/log/{id}`
- `/activity/cleared/log/{id}`

#### Custom package routes

[](#custom-package-routes)

If you wish to change the route paths, names or other options you can disable the default routes in your `.env` file by setting

```
LARAVEL_LOGGER_DISABLE_ROUTES=true
```

If you are on an existing install, you will also need update your `laravel-logger.php` config file to add the config option:

```
'disableRoutes' => env('LARAVEL_LOGGER_DISABLE_ROUTES', false),
```

You can then add the routes directly to your application's `routes/web.php` file, and customise as required.

```
Route::group(['prefix' => 'activity', 'namespace' => 'Notus\LaravelLogger\App\Http\Controllers', 'middleware' => ['web', 'auth', 'activity']], function () {

    // Dashboards
    Route::get('/', 'LaravelLoggerController@showAccessLog')->name('activity');
    Route::get('/cleared', ['uses' => 'LaravelLoggerController@showClearedActivityLog'])->name('cleared');

    // Drill Downs
    Route::get('/log/{id}', 'LaravelLoggerController@showAccessLogEntry');
    Route::get('/cleared/log/{id}', 'LaravelLoggerController@showClearedAccessLogEntry');

    // Forms
    Route::delete('/clear-activity', ['uses' => 'LaravelLoggerController@clearActivityLog'])->name('clear-activity');
    Route::delete('/destroy-activity', ['uses' => 'LaravelLoggerController@destroyActivityLog'])->name('destroy-activity');
    Route::post('/restore-log', ['uses' => 'LaravelLoggerController@restoreClearedActivityLog'])->name('restore-activity');
});
```

### Search

[](#search)

adding dynamic search fields (description , user, URL , method and ip address)

##### .env file

[](#env-file)

add these configurations to your .env file to control the logging search

```
LARAVEL_LOGGER_ENABLE_SEARCH=true
// you can customize your search using these options [description,user,method,route,ip]
LARAVEL_LOGGER_SEARCH_FIELDS=description,user,method,route,ip

```

by default all search fields are enabled when you enable the search with this one line configuration

```
LARAVEL_LOGGER_SEARCH_ENABLE=true

```

### Screenshots

[](#screenshots)

[![dashboard](https://camo.githubusercontent.com/011f5840d857f4e1fafff35ab87bfb243e943c10127fa8dfc9a279770063a35d/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f312d64617368626f6172642e6a7067)](https://camo.githubusercontent.com/011f5840d857f4e1fafff35ab87bfb243e943c10127fa8dfc9a279770063a35d/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f312d64617368626f6172642e6a7067)[![drilldown](https://camo.githubusercontent.com/0d8cdcabbb8d2720ef63066adb3dc9608cd2f50a9796194af5bc7fe5b8c1f7d9/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f322d6472696c6c646f776e2e6a7067)](https://camo.githubusercontent.com/0d8cdcabbb8d2720ef63066adb3dc9608cd2f50a9796194af5bc7fe5b8c1f7d9/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f322d6472696c6c646f776e2e6a7067)[![confirm-clear](https://camo.githubusercontent.com/ba23049d5909a0b9c96a78aabf77b418e41e74b31766e41fa4379a0f3441cccf/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f332d636f6e6669726d2d636c6561722e6a7067)](https://camo.githubusercontent.com/ba23049d5909a0b9c96a78aabf77b418e41e74b31766e41fa4379a0f3441cccf/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f332d636f6e6669726d2d636c6561722e6a7067)[![log-cleared-msg](https://camo.githubusercontent.com/ad59c94601985325b5da847df14ddf9a873a68724df872e8717cb29a8c47ca47/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f342d6c6f672d636c65617265642d6d73672e6a7067)](https://camo.githubusercontent.com/ad59c94601985325b5da847df14ddf9a873a68724df872e8717cb29a8c47ca47/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f342d6c6f672d636c65617265642d6d73672e6a7067)[![cleared-log](https://camo.githubusercontent.com/38872b7d81836913ff073851e13aa95729240449cace8b01bf084abd583921f8/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f352d636c65617265642d6c6f672e6a7067)](https://camo.githubusercontent.com/38872b7d81836913ff073851e13aa95729240449cace8b01bf084abd583921f8/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f352d636c65617265642d6c6f672e6a7067)[![confirm-restore](https://camo.githubusercontent.com/1f6c356f8647c547a28e9d8b0461875b1d9460abbf70567d73cd352cb9a4351e/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f352d636f6e6669726d2d726573746f72652e6a7067)](https://camo.githubusercontent.com/1f6c356f8647c547a28e9d8b0461875b1d9460abbf70567d73cd352cb9a4351e/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f352d636f6e6669726d2d726573746f72652e6a7067)[![confirm-destroy](https://camo.githubusercontent.com/e6db4db1f2295263dd83d374c93f9ed6767836e1178d98d20b04eb0c266ba031/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f362d636f6e6669726d2d64657374726f792e6a7067)](https://camo.githubusercontent.com/e6db4db1f2295263dd83d374c93f9ed6767836e1178d98d20b04eb0c266ba031/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f362d636f6e6669726d2d64657374726f792e6a7067)[![success-destroy](https://camo.githubusercontent.com/dc8e16a197d5191191120bda3fd94203f9be6ca087a802b7fe022617fbaa24b9/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f372d737563636573732d64657374726f792e6a7067)](https://camo.githubusercontent.com/dc8e16a197d5191191120bda3fd94203f9be6ca087a802b7fe022617fbaa24b9/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f372d737563636573732d64657374726f792e6a7067)[![success-restored](https://camo.githubusercontent.com/25c4742582db653197590e8abce85dc9fdb3492567c2e04dcc50e76bef7b76a1/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f382d737563636573732d726573746f7265642e6a7067)](https://camo.githubusercontent.com/25c4742582db653197590e8abce85dc9fdb3492567c2e04dcc50e76bef7b76a1/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f382d737563636573732d726573746f7265642e6a7067)[![cleared-drilldown](https://camo.githubusercontent.com/b1b81552f1dc65c6439e0d869b4fd92255a4fe0b66e93275405ce8eaa1a42d32/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f392d636c65617265642d6472696c6c646f776e2e6a7067)](https://camo.githubusercontent.com/b1b81552f1dc65c6439e0d869b4fd92255a4fe0b66e93275405ce8eaa1a42d32/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c2d6c6f676765722f392d636c65617265642d6472696c6c646f776e2e6a7067)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.1% 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 ~86 days

Total

13

Last Release

1489d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1228254?v=4)[notus](/maintainers/notus)[@Notus](https://github.com/Notus)

---

Top Contributors

[![jeremykenedy](https://avatars.githubusercontent.com/u/6244570?v=4)](https://github.com/jeremykenedy "jeremykenedy (128 commits)")[![azorpax](https://avatars.githubusercontent.com/u/12295737?v=4)](https://github.com/azorpax "azorpax (22 commits)")[![kop7](https://avatars.githubusercontent.com/u/18327186?v=4)](https://github.com/kop7 "kop7 (18 commits)")[![sudwebdesign](https://avatars.githubusercontent.com/u/1390644?v=4)](https://github.com/sudwebdesign "sudwebdesign (12 commits)")[![mohamedAbouda](https://avatars.githubusercontent.com/u/17221075?v=4)](https://github.com/mohamedAbouda "mohamedAbouda (12 commits)")[![alexandre433](https://avatars.githubusercontent.com/u/10622522?v=4)](https://github.com/alexandre433 "alexandre433 (5 commits)")[![robertjarec](https://avatars.githubusercontent.com/u/24313969?v=4)](https://github.com/robertjarec "robertjarec (5 commits)")[![diatama](https://avatars.githubusercontent.com/u/20448932?v=4)](https://github.com/diatama "diatama (4 commits)")[![enkia](https://avatars.githubusercontent.com/u/255730?v=4)](https://github.com/enkia "enkia (3 commits)")[![kentdahl](https://avatars.githubusercontent.com/u/2970005?v=4)](https://github.com/kentdahl "kentdahl (3 commits)")[![denydias](https://avatars.githubusercontent.com/u/948202?v=4)](https://github.com/denydias "denydias (3 commits)")[![TheNewSound](https://avatars.githubusercontent.com/u/1410503?v=4)](https://github.com/TheNewSound "TheNewSound (3 commits)")[![hittesh-ahuja-wdt](https://avatars.githubusercontent.com/u/53300489?v=4)](https://github.com/hittesh-ahuja-wdt "hittesh-ahuja-wdt (3 commits)")[![ibrahimMahfuz](https://avatars.githubusercontent.com/u/28502321?v=4)](https://github.com/ibrahimMahfuz "ibrahimMahfuz (2 commits)")[![KingComp](https://avatars.githubusercontent.com/u/6870506?v=4)](https://github.com/KingComp "KingComp (2 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (1 commits)")[![peyobr](https://avatars.githubusercontent.com/u/7716146?v=4)](https://github.com/peyobr "peyobr (1 commits)")[![arborrow](https://avatars.githubusercontent.com/u/532371?v=4)](https://github.com/arborrow "arborrow (1 commits)")

### Embed Badge

![Health badge](/badges/pnc-org-laravel-logger/health.svg)

```
[![Health](https://phpackages.com/badges/pnc-org-laravel-logger/health.svg)](https://phpackages.com/packages/pnc-org-laravel-logger)
```

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[directorytree/metrics

Record metrics in your Laravel application

26027.8k](/packages/directorytree-metrics)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

6392.1k](/packages/masterro-laravel-mail-viewer)[label84/laravel-auth-log

Log user authentication actions in Laravel.

3654.0k](/packages/label84-laravel-auth-log)

PHPackages © 2026

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