logging.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. | Deprecations Log Channel
  20. |--------------------------------------------------------------------------
  21. |
  22. | This option controls the log channel that should be used to log warnings
  23. | regarding deprecated PHP and library features. This allows you to get
  24. | your application ready for upcoming major versions of dependencies.
  25. |
  26. */
  27. 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
  28. /*
  29. |--------------------------------------------------------------------------
  30. | Log Channels
  31. |--------------------------------------------------------------------------
  32. |
  33. | Here you may configure the log channels for your application. Out of
  34. | the box, Laravel uses the Monolog PHP logging library. This gives
  35. | you a variety of powerful log handlers / formatters to utilize.
  36. |
  37. | Available Drivers: "single", "daily", "slack", "syslog",
  38. | "errorlog", "monolog",
  39. | "custom", "stack"
  40. |
  41. */
  42. 'channels' => [
  43. 'stack' => [
  44. 'driver' => 'stack',
  45. 'channels' => ['single'],
  46. 'ignore_exceptions' => false,
  47. ],
  48. 'single' => [
  49. 'driver' => 'single',
  50. 'path' => storage_path('logs/laravel.log'),
  51. 'level' => env('LOG_LEVEL', 'debug'),
  52. ],
  53. 'daily' => [
  54. 'driver' => 'daily',
  55. 'path' => storage_path('logs/laravel.log'),
  56. 'level' => env('LOG_LEVEL', 'debug'),
  57. 'days' => 14,
  58. ],
  59. 'slack' => [
  60. 'driver' => 'slack',
  61. 'url' => env('LOG_SLACK_WEBHOOK_URL'),
  62. 'username' => 'Laravel Log',
  63. 'emoji' => ':boom:',
  64. 'level' => env('LOG_LEVEL', 'critical'),
  65. ],
  66. 'papertrail' => [
  67. 'driver' => 'monolog',
  68. 'level' => env('LOG_LEVEL', 'debug'),
  69. 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
  70. 'handler_with' => [
  71. 'host' => env('PAPERTRAIL_URL'),
  72. 'port' => env('PAPERTRAIL_PORT'),
  73. 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
  74. ],
  75. ],
  76. 'stderr' => [
  77. 'driver' => 'monolog',
  78. 'level' => env('LOG_LEVEL', 'debug'),
  79. 'handler' => StreamHandler::class,
  80. 'formatter' => env('LOG_STDERR_FORMATTER'),
  81. 'with' => [
  82. 'stream' => 'php://stderr',
  83. ],
  84. ],
  85. 'syslog' => [
  86. 'driver' => 'syslog',
  87. 'level' => env('LOG_LEVEL', 'debug'),
  88. ],
  89. 'errorlog' => [
  90. 'driver' => 'errorlog',
  91. 'level' => env('LOG_LEVEL', 'debug'),
  92. ],
  93. 'null' => [
  94. 'driver' => 'monolog',
  95. 'handler' => NullHandler::class,
  96. ],
  97. 'emergency' => [
  98. 'path' => storage_path('logs/laravel.log'),
  99. ],
  100. ],
  101. ];