logging.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. use Monolog\Handler\StreamHandler;
  3. use Monolog\Handler\SyslogUdpHandler;
  4. return [
  5. /*
  6. |--------------------------------------------------------------------------
  7. | Default Log Channel
  8. |--------------------------------------------------------------------------
  9. |
  10. | This option defines the default log channel that gets used when writing
  11. | messages to the logs. The name specified in this option should match
  12. | one of the channels defined in the "channels" configuration array.
  13. |
  14. */
  15. 'default' => env('LOG_CHANNEL', 'stack'),
  16. /*
  17. |--------------------------------------------------------------------------
  18. | Log Channels
  19. |--------------------------------------------------------------------------
  20. |
  21. | Here you may configure the log channels for your application. Out of
  22. | the box, Laravel uses the Monolog PHP logging library. This gives
  23. | you a variety of powerful log handlers / formatters to utilize.
  24. |
  25. | Available Drivers: "single", "daily", "slack", "syslog",
  26. | "errorlog", "monolog",
  27. | "custom", "stack"
  28. |
  29. */
  30. 'channels' => [
  31. 'stack' => [
  32. 'driver' => 'stack',
  33. 'channels' => ['daily'],
  34. 'ignore_exceptions' => false,
  35. 'permission' => '0666'
  36. ],
  37. 'single' => [
  38. 'driver' => 'single',
  39. 'path' => storage_path('logs/laravel.log'),
  40. 'level' => 'debug',
  41. 'permission' => '0755'
  42. ],
  43. 'daily' => [
  44. 'driver' => 'daily',
  45. 'path' => storage_path('logs/laravel/laravel.log'),
  46. 'level' => 'debug',
  47. 'days' => 300,
  48. 'permission' => '0755'
  49. ],
  50. 'slack' => [
  51. 'driver' => 'slack',
  52. 'url' => env('LOG_SLACK_WEBHOOK_URL'),
  53. 'username' => 'Laravel Log',
  54. 'emoji' => ':boom:',
  55. 'level' => 'critical',
  56. 'permission' => '0666'
  57. ],
  58. 'papertrail' => [
  59. 'driver' => 'monolog',
  60. 'level' => 'debug',
  61. 'handler' => SyslogUdpHandler::class,
  62. 'handler_with' => [
  63. 'host' => env('PAPERTRAIL_URL'),
  64. 'port' => env('PAPERTRAIL_PORT'),
  65. ],
  66. 'permission' => '0666'
  67. ],
  68. 'stderr' => [
  69. 'driver' => 'monolog',
  70. 'handler' => StreamHandler::class,
  71. 'formatter' => env('LOG_STDERR_FORMATTER'),
  72. 'with' => [
  73. 'stream' => 'php://stderr',
  74. ],
  75. 'permission' => '0666'
  76. ],
  77. 'syslog' => [
  78. 'driver' => 'syslog',
  79. 'level' => 'debug',
  80. 'permission' => '0666'
  81. ],
  82. 'errorlog' => [
  83. 'driver' => 'errorlog',
  84. 'level' => 'debug',
  85. 'permission' => '0666'
  86. ],
  87. 'jobs' => [
  88. 'driver' => 'daily',
  89. 'path' => storage_path('logs/jobs/job.log'),
  90. 'level' => 'debug',
  91. 'days' => 300,
  92. 'permission' => '0666'
  93. ],
  94. 'event' => [
  95. 'driver' => 'daily',
  96. 'path' => storage_path('logs/events/event.log'),
  97. 'level' => 'debug',
  98. 'days' => 300,
  99. 'permission' => '0666'
  100. ],
  101. 'sql' => [
  102. 'driver' => 'daily',
  103. 'path' => storage_path('logs/sql/sql.log'),
  104. 'level' => 'debug',
  105. 'days' => 5,
  106. 'permission' => '0666'
  107. ],
  108. 'modify' => [
  109. 'driver' => 'daily',
  110. 'path' => storage_path('logs/modify/modify.log'),
  111. 'level' => 'debug',
  112. 'days' => 300,
  113. 'permission' => '0666'
  114. ],
  115. ],
  116. ];