logging.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. ],
  36. 'single' => [
  37. 'driver' => 'single',
  38. 'path' => storage_path('logs/laravel.log'),
  39. 'level' => 'debug',
  40. ],
  41. 'daily' => [
  42. 'driver' => 'daily',
  43. 'path' => storage_path('logs/laravel.log'),
  44. 'level' => 'debug',
  45. 'days' => 14,
  46. ],
  47. 'slack' => [
  48. 'driver' => 'slack',
  49. 'url' => env('LOG_SLACK_WEBHOOK_URL'),
  50. 'username' => 'Laravel Log',
  51. 'emoji' => ':boom:',
  52. 'level' => 'critical',
  53. ],
  54. 'papertrail' => [
  55. 'driver' => 'monolog',
  56. 'level' => 'debug',
  57. 'handler' => SyslogUdpHandler::class,
  58. 'handler_with' => [
  59. 'host' => env('PAPERTRAIL_URL'),
  60. 'port' => env('PAPERTRAIL_PORT'),
  61. ],
  62. ],
  63. 'stderr' => [
  64. 'driver' => 'monolog',
  65. 'handler' => StreamHandler::class,
  66. 'formatter' => env('LOG_STDERR_FORMATTER'),
  67. 'with' => [
  68. 'stream' => 'php://stderr',
  69. ],
  70. ],
  71. 'syslog' => [
  72. 'driver' => 'syslog',
  73. 'level' => 'debug',
  74. ],
  75. 'errorlog' => [
  76. 'driver' => 'errorlog',
  77. 'level' => 'debug',
  78. ],
  79. ],
  80. ];