logging.php 3.5 KB

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