2017 © Pedro Peláez
 

library logger

create log file

image

div-art/logger

create log file

  • Friday, April 27, 2018
  • by div-art
  • Repository
  • 4 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Logger

Logger package for Laravel, (*1)

Installation

To install, run the following in your project directory:, (*2)

``` bash $ composer require div-art/logger, (*3)


If you are using laravel version >= 5.5 you can skip this step: In `config/app.php` add the following to the `providers` array:

\DivArt\Logger\LoggerServiceProvider::class,, (*4)


Also in config/app.php, add the Facade class to the aliases array:

'Logger' => \DivArt\Logger\Facades\Logger::class,, (*5)


## Configuration To publish Logger's configuration file, run the following `vendor:publish` command:

php artisan vendor:publish --provider="DivArt\Logger\LoggerServiceProvider", (*6)


It will create `logger.php` file in `config/logger.php`. To manage directory for storing logs just change default value of `'path'`:

//the root is storage directory 'path' => 'your path',, (*7)


By default logs lifetime is `7` days, to change it:

//if you set this to 0 - logs will not be deleted 'expire_days' => 7, (*8)


## Usage ** Do not forget to include the namespace for the controller class where you plan to use this library **

use DivArt\Logger\Facades\Logger;, (*9)


But if you are using laravel >= 5.5 you can skip this. ## Example: ``` php Logger::save(array('name' => 'sani', 'year' => '30'));

Create logfile in default path 'storage/logger' whith name date.json, (*10)

date.json:, (*11)

{ 'name' => 'sani', 'year' => '30' }, (*12)

Route:

``` php //get all logs Route::get('/div-art/logger/all/{date?}');, (*13)


To manage all your logs go to this link example in browser `http://your-app.xyz/div-art/logger/all` ## Methods: ``` php Logger::save(data, 'mark'); Logger::info(data, 'mark'); Logger::danger(data, 'mark'); Logger::success(data, 'mark'); //data - data (string, number, boolean value, array, object), required parameter //mark - string mark for filtering logs, optional parameter Logger::request('key'); Logger::input('key'); Logger::json('key'); Logger::post('key'); Logger::get('key'); Logger::php('key'); Logger::server('key'); Logger::cookies('key'); Logger::headers('key'); //key - is an optional parameter that specifies a particular key from an array or object to be written

License

The MIT License (MIT). Please see License File for more information."# Logger" "# Logger", (*14)

The Versions

27/04 2018

dev-master

9999999-dev

create log file

  Sources   Download

MIT

The Requires

 

by Avatar div-art

26/04 2018

1.0.6

1.0.6.0

create log file

  Sources   Download

MIT

The Requires

 

by Avatar div-art

24/01 2018

1.0.4

1.0.4.0

create log file

  Sources   Download

MIT

The Requires

 

by Avatar div-art

24/01 2018

1.0.5

1.0.5.0

create log file

  Sources   Download

MIT

The Requires

 

by Avatar div-art

22/01 2018

1.0.3

1.0.3.0

create log file

  Sources   Download

MIT

The Requires

 

by Avatar div-art

21/01 2018

1.0.2

1.0.2.0

create log file

  Sources   Download

MIT

The Requires

 

by Avatar div-art

18/01 2018

1.0.1

1.0.1.0

create log file

  Sources   Download

MIT

The Requires

 

by Avatar div-art

18/01 2018

1.0.0

1.0.0.0

create log file

  Sources   Download

MIT

The Requires

 

by Avatar div-art