Settle on Facades in service providers.
This commit is contained in:
parent
45f0b4f9d9
commit
2f998b2095
|
@ -1,20 +1,16 @@
|
||||||
<?php namespace App\Providers;
|
<?php namespace App\Providers;
|
||||||
|
|
||||||
use Exception;
|
use App, Log, Exception;
|
||||||
use Illuminate\Contracts\Logging\Log;
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Illuminate\Contracts\Exception\Handler;
|
|
||||||
|
|
||||||
class ErrorServiceProvider extends ServiceProvider {
|
class ErrorServiceProvider extends ServiceProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register any error handlers.
|
* Register any error handlers.
|
||||||
*
|
*
|
||||||
* @param Handler $handler
|
|
||||||
* @param Log $log
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function boot(Handler $handler, Log $log)
|
public function boot()
|
||||||
{
|
{
|
||||||
// Here you may handle any errors that occur in your application, including
|
// Here you may handle any errors that occur in your application, including
|
||||||
// logging them or displaying custom views for specific errors. You may
|
// logging them or displaying custom views for specific errors. You may
|
||||||
|
@ -22,9 +18,9 @@ public function boot(Handler $handler, Log $log)
|
||||||
// exceptions. If nothing is returned, the default error view is
|
// exceptions. If nothing is returned, the default error view is
|
||||||
// shown, which includes a detailed stack trace during debug.
|
// shown, which includes a detailed stack trace during debug.
|
||||||
|
|
||||||
$handler->error(function(Exception $e) use ($log)
|
App::error(function(Exception $e)
|
||||||
{
|
{
|
||||||
$log->error($e);
|
Log::error($e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php namespace App\Providers;
|
<?php namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Contracts\Logging\Log;
|
use Log;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class LogServiceProvider extends ServiceProvider {
|
class LogServiceProvider extends ServiceProvider {
|
||||||
|
@ -8,12 +8,11 @@ class LogServiceProvider extends ServiceProvider {
|
||||||
/**
|
/**
|
||||||
* Configure the application's logging facilities.
|
* Configure the application's logging facilities.
|
||||||
*
|
*
|
||||||
* @param Log $log
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function boot(Log $log)
|
public function boot()
|
||||||
{
|
{
|
||||||
$log->useFiles(storage_path().'/logs/laravel.log');
|
Log::useFiles(storage_path().'/logs/laravel.log');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue