error.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. return array(
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Ignored Error Levels
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here you may specify the error levels that should be ignored by the
  9. | Laravel error handler. These levels will still be logged; however, no
  10. | information about about them will be displayed.
  11. |
  12. */
  13. 'ignore' => array(E_NOTICE, E_USER_NOTICE, E_DEPRECATED, E_USER_DEPRECATED),
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Error Detail
  17. |--------------------------------------------------------------------------
  18. |
  19. | Detailed error messages contain information about the file in which an
  20. | error occurs, as well as a PHP stack trace containing the call stack.
  21. |
  22. | If your application is in production, consider turning off error details
  23. | for enhanced security and user experience. The error stack trace could
  24. | contain sensitive information that should not be publicly visible.
  25. |
  26. */
  27. 'detail' => true,
  28. /*
  29. |--------------------------------------------------------------------------
  30. | Error Logging
  31. |--------------------------------------------------------------------------
  32. |
  33. | When error logging is enabled, the "logger" Closure defined below will
  34. | be called for every error in your application. You are free to log the
  35. | errors however you want. Enjoy the flexibility.
  36. |
  37. */
  38. 'log' => false,
  39. /*
  40. |--------------------------------------------------------------------------
  41. | Error Logger
  42. |--------------------------------------------------------------------------
  43. |
  44. | Because of the various ways of managing error logging, you get complete
  45. | flexibility to manage error logging as you see fit. This function will
  46. | be called anytime an error occurs within your application and error
  47. | logging is enabled.
  48. |
  49. | You may log the error message however you like; however, a simple log
  50. | solution has been setup for you which will log all error messages to
  51. | a single text file within the application storage directory.
  52. |
  53. | Of course, you are free to implement more complex solutions including
  54. | emailing the exceptions details to your team, etc.
  55. |
  56. */
  57. 'logger' => function($exception)
  58. {
  59. $message = (string) $exception;
  60. File::append(STORAGE_PATH.'log.txt', date('Y-m-d H:i:s').' - '.$message.PHP_EOL);
  61. },
  62. );