PHPackages                             merkeleon/laravel-log - 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. merkeleon/laravel-log

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

merkeleon/laravel-log
=====================

Laravel Audit Log

1.4.6(3y ago)029.7k↓50%5PHPPHP &gt;=7.1

Since Dec 11Pushed 3y ago2 watchersCompare

[ Source](https://github.com/Merkeleon/laravel-log)[ Packagist](https://packagist.org/packages/merkeleon/laravel-log)[ RSS](/packages/merkeleon-laravel-log/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (18)Used By (0)

Laravel log
===========

[](#laravel-log)

Laravel module for logs generating

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

[](#installation)

First, require the package using Composer:

`composer require merkeleon/laravel-log`

1. Add new class Log that should extend Merkeleon\\Log\\Model\\Log
2. Custom your log class.

    - Add protected static attribute $table - the name of table or elastic search index
    - Add custom parameters $customAttributes. By default only parameters Log::$attributes will be save. The keys of Log::$customAttributes are parameters identificators. The values of Log::$customAttributes are casts. Following casts are supported:
        - int
        - float
        - string
        - bool
        - array
    - You can add validation rules.
    - If you want to duplicate your logs to files you should override function toLogFileArray
3. Add the merkeleon\_log.php config `php artisan vendor:publish --provider="Merkeleon\Log\Providers\MerkeleonLogProvider"`

    - Point your log class
    - Point the driver (mysql or elastic)
    - If you want to duplicate your logs to files you should point the path to log file.
4. If you want save your logs to buffer and then bulk write all logs from buffer to storage

    - Add buffer directory path to the merkeleon\_log.php config. Buffer directory should be writable
    - You should empty your buffer by calling command `php artisan merkeleon:log:bulk-insert-to-storage {logName}`

\###Example:

```
