logging.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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' => ['single'],
  34. ],
  35. 'single' => [
  36. 'driver' => 'single',
  37. 'path' => storage_path('logs/laravel.log'),
  38. 'level' => 'debug',
  39. ],
  40. 'daily' => [
  41. 'driver' => 'daily',
  42. 'path' => storage_path('logs/laravel.log'),
  43. 'level' => 'debug',
  44. 'days' => 7,
  45. ],
  46. 'slack' => [
  47. 'driver' => 'slack',
  48. 'url' => env('LOG_SLACK_WEBHOOK_URL'),
  49. 'username' => 'Laravel Log',
  50. 'emoji' => ':boom:',
  51. 'level' => 'critical',
  52. ],
  53. 'papertrail' => [
  54. 'driver' => 'monolog',
  55. 'handler' => SyslogUdpHandler::class,
  56. 'handler_with' => [
  57. 'host' => env('PAPERTRAIL_URL'),
  58. 'port' => env('PAPERTRAIL_PORT'),
  59. ],
  60. ],
  61. 'stderr' => [
  62. 'driver' => 'monolog',
  63. 'handler' => StreamHandler::class,
  64. 'with' => [
  65. 'stream' => 'php://stderr',
  66. ],
  67. ],
  68. 'syslog' => [
  69. 'driver' => 'syslog',
  70. 'level' => 'debug',
  71. ],
  72. 'errorlog' => [
  73. 'driver' => 'errorlog',
  74. 'level' => 'debug',
  75. ],
  76. ],
  77. ];