Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
2f998b20
Commit
2f998b20
authored
Aug 29, 2014
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Settle on Facades in service providers.
parent
45f0b4f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
app/Providers/ErrorServiceProvider.php
+4
-8
app/Providers/LogServiceProvider.php
+3
-4
No files found.
app/Providers/ErrorServiceProvider.php
View file @
2f998b20
<?php
namespace
App\Providers
;
use
Exception
;
use
Illuminate\Contracts\Logging\Log
;
use
App
,
Log
,
Exception
;
use
Illuminate\Support\ServiceProvider
;
use
Illuminate\Contracts\Exception\Handler
;
class
ErrorServiceProvider
extends
ServiceProvider
{
/**
* Register any error handlers.
*
* @param Handler $handler
* @param Log $log
* @return void
*/
public
function
boot
(
Handler
$handler
,
Log
$log
)
public
function
boot
()
{
// Here you may handle any errors that occur in your application, including
// logging them or displaying custom views for specific errors. You may
...
...
@@ -22,9 +18,9 @@ class ErrorServiceProvider extends ServiceProvider {
// exceptions. If nothing is returned, the default error view is
// 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
);
});
}
...
...
app/Providers/LogServiceProvider.php
View file @
2f998b20
<?php
namespace
App\Providers
;
use
Illuminate\Contracts\Logging\
Log
;
use
Log
;
use
Illuminate\Support\ServiceProvider
;
class
LogServiceProvider
extends
ServiceProvider
{
...
...
@@ -8,12 +8,11 @@ class LogServiceProvider extends ServiceProvider {
/**
* Configure the application's logging facilities.
*
* @param Log $log
* @return void
*/
public
function
boot
(
Log
$log
)
public
function
boot
()
{
$log
->
useFiles
(
storage_path
()
.
'/logs/laravel.log'
);
Log
::
useFiles
(
storage_path
()
.
'/logs/laravel.log'
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment