logging.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. ],
  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' => 14,
  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. 'level' => 'debug',
  56. 'handler' => SyslogUdpHandler::class,
  57. 'handler_with' => [
  58. 'host' => env('PAPERTRAIL_URL'),
  59. 'port' => env('PAPERTRAIL_PORT'),
  60. ],
  61. ],
  62. 'stderr' => [
  63. 'driver' => 'monolog',
  64. 'handler' => StreamHandler::class,
  65. 'with' => [
  66. 'stream' => 'php://stderr',
  67. ],
  68. ],
  69. 'syslog' => [
  70. 'driver' => 'syslog',
  71. 'level' => 'debug',
  72. ],
  73. 'errorlog' => [
  74. 'driver' => 'errorlog',
  75. 'level' => 'debug',
  76. ],
  77. ],
  78. ];