2017 © Pedro Peláez
 

library logsifier

Package to manage application logs

image

metalcoder/logsifier

Package to manage application logs

  • Sunday, October 23, 2016
  • by metalcoder
  • Repository
  • 0 Watchers
  • 0 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Synopsis

Package to manage application logs., (*1)

Code Example

Just use the Facade Logsifier to call any method., (*2)

Logsifier::store('192.168.1.1','users','1','New user created','Users module'), (*3)

Don't forget this line at the begining of your file:, (*4)

use Metalcoder/Logsifier/Logsifier;, (*5)

Motivation

I've been involved in several projects where is required to have some sort of log manipulation. I decided to create my own package first of all to introduce myself in package development and also to use it on my future projects., (*6)

Installation

Install via composer: 1. Add the line "metalcoder/logsifier": "master-dev" to your app main composer in the require section. 2. Make composer update 3. Make php artisan migrate --path=vendor/metalcoder/logsifier/src/migrations to run the package migration in charge of the creation of log table. 4. Go to config/app.php in your app and add Metalcoder\Logsifier\MetalcoderLogsifierServiceProvider::class, to the providers section. 5. In config/app.php add 'Logsifier' => Metalcoder\Logsifier\Logsifier::class, to the aliases section. 6. In config/app.php add Maatwebsite\Excel\ExcelServiceProvider::class, to the providers section. 7. In config/app.php add 'Excel' => Maatwebsite\Excel\Facades\Excel::class, to the aliases section. 8. Make php artisan vendor:publish 9. Now you are ready to go., (*7)

API Reference

The package exposes 4 methods (at the time) to help with the log of relevant events in any laravel application., (*8)

/* Method to store a log entry in the database * Parameters: $ip : IP of the request * $object : Name of the database table the event is using * $object_id : id of the element the event is using * $description : Short descripcion of the event. * $source : Name of the application module that triggered the event * $urgent : If entry is marked as urgent an email will be sent to the recipients listed in config/logsifier.php */ Logsifier::store($ip,$object,$object_id,$description,$source,$urgent), (*9)

/* Method to show all the log entries * */ Logsifier::index(), (*10)

/* Method to export to a CSV file all the log entries * */ Logsifier::exportCSV(), (*11)

/* Method to export all entries to a CSV file and empty the log table. * */ Logsifier::rotate(), (*12)

License

GNU GENERAL PUBLIC LICENSE, (*13)

The Versions

23/10 2016

dev-master

9999999-dev

Package to manage application logs

  Sources   Download

MIT

The Requires

 

by Yunior Rodriguez

laravel logs