logging.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. use Monolog\Handler\StreamHandler;
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Default Log Channel
  7. |--------------------------------------------------------------------------
  8. |
  9. | This option defines the default log channel that gets used when writing
  10. | messages to the logs. The name specified in this option should match
  11. | one of the channels defined in the "channels" configuration array.
  12. |
  13. */
  14. 'default' => env('LOG_CHANNEL', 'stack'),
  15. /*
  16. |--------------------------------------------------------------------------
  17. | Log Channels
  18. |--------------------------------------------------------------------------
  19. |
  20. | Here you may configure the log channels for your application. Out of
  21. | the box, Laravel uses the Monolog PHP logging library. This gives
  22. | you a variety of powerful log handlers / formatters to utilize.
  23. |
  24. | Available Drivers: "single", "daily", "slack", "syslog",
  25. | "errorlog", "monolog",
  26. | "custom", "stack"
  27. |
  28. */
  29. 'channels' => [
  30. 'stack' => [
  31. 'driver' => 'stack',
  32. 'channels' => ['single'],
  33. ],
  34. 'single' => [
  35. 'driver' => 'single',
  36. 'path' => storage_path('logs/laravel.log'),
  37. 'level' => 'debug',
  38. ],
  39. 'daily' => [
  40. 'driver' => 'daily',
  41. 'path' => storage_path('logs/laravel.log'),
  42. 'level' => 'debug',
  43. 'days' => 7,
  44. ],
  45. 'slack' => [
  46. 'driver' => 'slack',
  47. 'url' => env('LOG_SLACK_WEBHOOK_URL'),
  48. 'username' => 'Laravel Log',
  49. 'emoji' => ':boom:',
  50. 'level' => 'critical',
  51. ],
  52. 'stderr' => [
  53. 'driver' => 'monolog',
  54. 'handler' => StreamHandler::class,
  55. 'with' => [
  56. 'stream' => 'php://stderr',
  57. ],
  58. ],
  59. 'syslog' => [
  60. 'driver' => 'syslog',
  61. 'level' => 'debug',
  62. ],
  63. 'errorlog' => [
  64. 'driver' => 'errorlog',
  65. 'level' => 'debug',
  66. ],
  67. ],
  68. ];