logging.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. use Monolog\Handler\NullHandler;
  3. use Monolog\Handler\StreamHandler;
  4. use Monolog\Processor\PsrLogMessageProcessor;
  5. return [
  6. 'default' => env('LOG_CHANNEL', 'stack'),
  7. 'channels' => [
  8. 'stack' => [
  9. 'driver' => 'stack',
  10. 'channels' => ['single'],
  11. 'ignore_exceptions' => false,
  12. ],
  13. 'single' => [
  14. 'driver' => 'single',
  15. 'path' => storage_path('logs/laravel.log'),
  16. 'level' => env('LOG_LEVEL', 'debug'),
  17. 'replace_placeholders' => true,
  18. ],
  19. 'daily' => [
  20. 'driver' => 'daily',
  21. 'path' => storage_path('logs/laravel.log'),
  22. 'level' => env('LOG_LEVEL', 'debug'),
  23. 'days' => 14,
  24. 'replace_placeholders' => true,
  25. ],
  26. 'slack' => [
  27. 'driver' => 'slack',
  28. 'url' => env('LOG_SLACK_WEBHOOK_URL'),
  29. 'username' => 'Laravel Log',
  30. 'emoji' => ':boom:',
  31. 'level' => env('LOG_LEVEL', 'critical'),
  32. 'replace_placeholders' => true,
  33. ],
  34. 'papertrail' => [
  35. 'driver' => 'monolog',
  36. 'level' => env('LOG_LEVEL', 'debug'),
  37. 'handler' => env('LOG_PAPERTRAIL_HANDLER', Monolog\Handler\SyslogUdpHandler::class),
  38. 'handler_with' => [
  39. 'host' => env('PAPERTRAIL_URL'),
  40. 'port' => env('PAPERTRAIL_PORT'),
  41. 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
  42. ],
  43. ],
  44. 'stderr' => [
  45. 'driver' => 'monolog',
  46. 'level' => env('LOG_LEVEL', 'debug'),
  47. 'handler' => StreamHandler::class,
  48. 'formatter' => env('LOG_STDERR_FORMATTER'),
  49. 'with' => [
  50. 'stream' => 'php://stderr',
  51. ],
  52. 'processors' => [PsrLogMessageProcessor::class],
  53. ],
  54. 'syslog' => [
  55. 'driver' => 'syslog',
  56. 'level' => env('LOG_LEVEL', 'debug'),
  57. 'facility' => LOG_USER,
  58. 'replace_placeholders' => true,
  59. ],
  60. 'errorlog' => [
  61. 'driver' => 'errorlog',
  62. 'level' => env('LOG_LEVEL', 'debug'),
  63. 'replace_placeholders' => true,
  64. ],
  65. 'null' => [
  66. 'driver' => 'monolog',
  67. 'handler' => NullHandler::class,
  68. ],
  69. 'emergency' => [
  70. 'path' => storage_path('logs/laravel.log'),
  71. ],
  72. 'sql' => [
  73. 'driver' => 'daily',
  74. 'path' => storage_path('logs/sql.log'),
  75. 'level' => env('LOG_LEVEL', 'debug'),
  76. 'days' => 14,
  77. 'replace_placeholders' => true,
  78. ],
  79. ],
  80. ];