logging.php 2.6 KB

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