Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StreamLogWriter.php

class StreamLogWriter

Hierarchy

  • class \OpenTelemetry\API\Behavior\Internal\LogWriter\StreamLogWriter implements \OpenTelemetry\API\Behavior\Internal\LogWriter\LogWriterInterface

Expanded class hierarchy of StreamLogWriter

1 file declares its use of StreamLogWriter
LogWriterFactory.php in vendor/open-telemetry/api/Behavior/Internal/LogWriterFactory.php

File

vendor/open-telemetry/api/Behavior/Internal/LogWriter/StreamLogWriter.php, line 7

Namespace

OpenTelemetry\API\Behavior\Internal\LogWriter
View source
class StreamLogWriter implements LogWriterInterface {
    private $stream;
    public function __construct(string $destination) {
        $stream = fopen($destination, 'a');
        if ($stream) {
            $this->stream = $stream;
        }
        else {
            throw new \RuntimeException(sprintf('Unable to open %s for writing', $destination));
        }
    }
    public function write($level, string $message, array $context) : void {
        fwrite($this->stream, Formatter::format($level, $message, $context));
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
StreamLogWriter::$stream private property
StreamLogWriter::write public function Overrides LogWriterInterface::write
StreamLogWriter::__construct public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal