ErrorServiceProvider.php 826 B

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