logging.php 2.6 KB

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