logging.php 2.2 KB

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