class ExporterFactory
Same name in this branch
- 11.1.x vendor/open-telemetry/sdk/Trace/ExporterFactory.php \OpenTelemetry\SDK\Trace\ExporterFactory
Hierarchy
- class \OpenTelemetry\SDK\Logs\ExporterFactory
Expanded class hierarchy of ExporterFactory
File
-
vendor/
open-telemetry/ sdk/ Logs/ ExporterFactory.php, line 13
Namespace
OpenTelemetry\SDK\LogsView source
class ExporterFactory {
public function create() : LogRecordExporterInterface {
$exporters = Configuration::getList(Variables::OTEL_LOGS_EXPORTER);
if (1 !== count($exporters)) {
throw new InvalidArgumentException(sprintf('Configuration %s requires exactly 1 exporter', Variables::OTEL_LOGS_EXPORTER));
}
$exporter = $exporters[0];
if ($exporter === 'none') {
return new NoopExporter();
}
$factory = Registry::logRecordExporterFactory($exporter);
return $factory->create();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
ExporterFactory::create | public | function |