Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / syslog / tests / modules / syslog_test / src / Logger / SysLogTest.php
diff --git a/web/core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php b/web/core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php
new file mode 100644 (file)
index 0000000..c7abeb0
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+namespace Drupal\syslog_test\Logger;
+
+use Drupal\syslog\Logger\SysLog;
+use Psr\Log\LoggerInterface;
+
+/**
+ * Redirects logging messages to error_log.
+ */
+class SysLogTest extends SysLog implements LoggerInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function syslogWrapper($level, $entry) {
+    $log_path = \Drupal::service('file_system')->realpath('public://syslog.log');
+    error_log($entry . PHP_EOL, 3, $log_path);
+  }
+
+}