ErrorServiceProvider.php 801 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php namespace App\Providers;
  2. use App, Log;
  3. use Exception;
  4. use Illuminate\Support\ServiceProvider;
  5. class ErrorServiceProvider extends ServiceProvider {
  6. /**
  7. * Register any error handlers.
  8. *
  9. * @return void
  10. */
  11. public function boot()
  12. {
  13. // Here you may handle any errors that occur in your application, including
  14. // logging them or displaying custom views for specific errors. You may
  15. // even register several error handlers to handle different types of
  16. // exceptions. If nothing is returned, the default error view is
  17. // shown, which includes a detailed stack trace during debug.
  18. App::error(function(Exception $exception, $code)
  19. {
  20. Log::error($exception);
  21. });
  22. }
  23. /**
  24. * Register the service provider.
  25. *
  26. * @return void
  27. */
  28. public function register()
  29. {
  30. //
  31. }
  32. }