logging.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. use Monolog\Handler\StreamHandler;
  3. use Monolog\Handler\SyslogUdpHandler;
  4. return [
  5. /*
  6. * Benchmark note:
  7. *
  8. * If Laravel does not have a log defined it will open an emergency log file and log
  9. * errors to the filesystem. This configuration sends logs to stdout instead.
  10. * php-fpm directs these to /dev/null unless "catch_workers_output = yes" is set in php-fpm.conf
  11. *
  12. */
  13. /*
  14. |--------------------------------------------------------------------------
  15. | Default Log Channel
  16. |--------------------------------------------------------------------------
  17. |
  18. | This option defines the default log channel that gets used when writing
  19. | messages to the logs. The name specified in this option should match
  20. | one of the channels defined in the "channels" configuration array.
  21. |
  22. */
  23. 'default' => env('LOG_CHANNEL', 'stdout'),
  24. /*
  25. |--------------------------------------------------------------------------
  26. | Log Channels
  27. |--------------------------------------------------------------------------
  28. |
  29. | Here you may configure the log channels for your application. Out of
  30. | the box, Laravel uses the Monolog PHP logging library. This gives
  31. | you a variety of powerful log handlers / formatters to utilize.
  32. |
  33. | Available Drivers: "single", "daily", "slack", "syslog",
  34. | "errorlog", "monolog",
  35. | "custom", "stack"
  36. |
  37. */
  38. 'channels' => [
  39. 'stdout' => [
  40. 'driver' => 'monolog',
  41. 'handler' => StreamHandler::class,
  42. 'formatter' => env('LOG_STDERR_FORMATTER'),
  43. 'with' => [
  44. 'stream' => 'php://stdout',
  45. ],
  46. ],
  47. ],
  48. ];