logging.php 4.4 KB

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