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\LogWriterView 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 |