logging.php 2.7 KB

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