Ei kuvausta

logging.php 3.5KB

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' => SyslogUdpHandler::class,
  70. 'handler_with' => [
  71. 'host' => env('PAPERTRAIL_URL'),
  72. 'port' => env('PAPERTRAIL_PORT'),
  73. ],
  74. ],
  75. 'stderr' => [
  76. 'driver' => 'monolog',
  77. 'level' => env('LOG_LEVEL', 'debug'),
  78. 'handler' => StreamHandler::class,
  79. 'formatter' => env('LOG_STDERR_FORMATTER'),
  80. 'with' => [
  81. 'stream' => 'php://stderr',
  82. ],
  83. ],
  84. 'syslog' => [
  85. 'driver' => 'syslog',
  86. 'level' => env('LOG_LEVEL', 'debug'),
  87. ],
  88. 'errorlog' => [
  89. 'driver' => 'errorlog',
  90. 'level' => env('LOG_LEVEL', 'debug'),
  91. ],
  92. 'null' => [
  93. 'driver' => 'monolog',
  94. 'handler' => NullHandler::class,
  95. ],
  96. 'emergency' => [
  97. 'path' => storage_path('logs/laravel.log'),
  98. ],
  99. ],
  100. ];