PHPackages                             mdhossain/laravel-logs - 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. mdhossain/laravel-logs

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

mdhossain/laravel-logs
======================

Audit logs and Error logs for laravel

110HTMLCI failing

Since Oct 27Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

How to use Audit and Error Logs in your laravel app
===================================================

[](#how-to-use-audit-and-error-logs-in-your-laravel-app)

Its easy to use in your laravel app. You can save all audit and error log type data and then also show all in your laravel app. Easy to track your actions and also find errors from your application by using this package. All logs are stored in database in this package.

Getting Started
---------------

[](#getting-started)

- Create a fresh laravel package

```
composer create-project --prefer-dist laravel/laravel packagetestapp

```

- change directory to the new folder

```
cd packagetestapp

```

- When it's done you need to configure your env file and set your app key and other necessary details. In your terminal type:

```
cp .env.example .env

```

- generate the app key

```
php artisan key:generate

```

- You can install the package via composer::

```
composer require mdhossain/laravel-logs

```

- Next, we need to add our new Service Provider in our `config/app.php` inside the `providers` array:

```
'providers' => [
         ...,
            App\Providers\RouteServiceProvider::class,
            // Our new package class
            Mdhossain\LaravelLogs\LaravelLogsServiceProvider::class,
         ],

```

- Migrate the database tables

```
php artisan migrate:refresh

```

- You can use your controller for log data save:

```
use MDHossain\laravelLogs\Contracts\ActivityLogInterface;

public function insertUser(ActivityLogInterface $activitylog){

    $activitylog->dataSave($id=null, $log_description, $data, $log_title, $log_type);

}

```

- You can use your controller for log data show:

```
use MDHossain\laravelLogs\Contracts\ActivityLogInterface;

public function showLogs(ActivityLogInterface $activitylog){

    For audit logs
    $activitylog->getAllAuditLogs();

    For error logs
    $activitylog->getAllErrorLogs();

}

```

- You can use your controller for log data show by date wise search:

```
use MDHossain\laravelLogs\Contracts\ActivityLogInterface;

public function filterLogs(ActivityLogInterface $activitylog){

    For audit logs Search by to date and from date
    $activitylog->allAuditLogs($search = array();

    For error logs Search by to date and from date
    $activitylog->allErrorLogs($search = array();

}

```

- You can browse for log show:

```
http://localhost:8000/audit-log
http://localhost:8000/error-log

```

OR

- Call your controller direct view

```
return view('laravel-logs::auditlogs.audit-log');
return view('laravel-logs::errorlogs.error-log');

```

And finally, start the application by running:

```
php artisan serve

```

Visit  in your browser to view the demo.

Built With
----------

[](#built-with)

- [Laravel](https://laravel.com/) - The PHP framework for web artisans.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6dd0759a9d8222a8539df01249b996a4555974d5610eee4b115bcd68f589bfb6?d=identicon)[hossaincse2](/maintainers/hossaincse2)

---

Top Contributors

[![hossaincse2](https://avatars.githubusercontent.com/u/17110805?v=4)](https://github.com/hossaincse2 "hossaincse2 (28 commits)")

### Embed Badge

![Health badge](/badges/mdhossain-laravel-logs/health.svg)

```
[![Health](https://phpackages.com/badges/mdhossain-laravel-logs/health.svg)](https://phpackages.com/packages/mdhossain-laravel-logs)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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