2017 © Pedro Peláez
 

library log

Laravel log

image

l-j/log

Laravel log

  • Wednesday, August 3, 2016
  • by jiangqiang
  • Repository
  • 1 Watchers
  • 1 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

laravel-channel-log

Make it possiable to log in different channels and streams., (*1)

Installation

Require this package in your composer.json and run composer update (or run composer require l-j/log:dev-master directly):, (*2)

l-j/log:dev-master

Config

After updating composer, add the ServiceProvider to the providers array in app/config/app.php and remove the default log provider, (*3)

//'Illuminate\Log\LogServiceProvider',
'LJ\Log\LogServiceProvider', 

If you want to use the facade to log messages, add this to your facades and remove the default log facade in app.php:, (*4)

//'Log' => 'Illuminate\Support\Facades\Log',
'Log'   => 'LJ\Log\Facades\Log',

Remove the Log::useFiles(storage_path().'/logs/laravel.log') in app/start/global/php;, (*5)

If you want to overwrite the config by command:, (*6)

$ php artisan config:publish l-j/log, (*7)

then in the app/packages, you can customize the config yourself. Note: the default config and the default channel is required., (*8)

Usage

Log::info($channel, $msg [, array $context]);, (*9)

There is just a default named default channel in the config, that means we can use like, (*10)

Log::info('default', $msg [, $context]);., (*11)

If you are annoy to do this you can just ignire the $channel parameter, like, (*12)

Log::info($msg [, array $context]), (*13)

, the vender will automatic filling with default channel., (*14)

Of course, you can add your own channel by config publish and overwrite it:, (*15)

// other channel
'api' => array(
        //streams
        'info'      => array(),
        'warning'   => array(),
        'error'     => array(),
    ),

the streams config options is same as the top default config like path, enable, daily, bubble, pathMode, fileMode. The code will merge them. Then the useage code will like this:, (*16)

Log::info('api', $msg [, array $context])., (*17)

The Versions

03/08 2016

dev-master

9999999-dev

Laravel log

  Sources   Download

The Requires

 

by Avatar jiangqiang

09/10 2014

1.0.0

1.0.0.0

Laravel log

  Sources   Download

The Requires

 

by Avatar jiangqiang