set schemaUrl for logs output (#1071)
This commit is contained in:
parent
cc92a07eac
commit
3246ca8e4d
|
|
@ -35,7 +35,7 @@ $loggerProvider = new LoggerProvider(
|
||||||
(new LogRecordLimitsBuilder())->build()->getAttributeFactory()
|
(new LogRecordLimitsBuilder())->build()->getAttributeFactory()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$logger = $loggerProvider->getLogger('demo', '1.0', 'http://schema.url', ['foo' => 'bar']);
|
$logger = $loggerProvider->getLogger('demo', '1.0', 'https://opentelemetry.io/schemas/1.7.1', ['foo' => 'bar']);
|
||||||
$eventLogger = new EventLogger($logger, 'my-domain');
|
$eventLogger = new EventLogger($logger, 'my-domain');
|
||||||
|
|
||||||
$record = (new LogRecord(['foo' => 'bar', 'baz' => 'bat', 'msg' => 'hello world']))
|
$record = (new LogRecord(['foo' => 'bar', 'baz' => 'bat', 'msg' => 'hello world']))
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,7 @@ class LogsConverter
|
||||||
$this->setAttributes($pInstrumentationScope, $instrumentationScope->getAttributes());
|
$this->setAttributes($pInstrumentationScope, $instrumentationScope->getAttributes());
|
||||||
$pInstrumentationScope->setDroppedAttributesCount($instrumentationScope->getAttributes()->getDroppedAttributesCount());
|
$pInstrumentationScope->setDroppedAttributesCount($instrumentationScope->getAttributes()->getDroppedAttributesCount());
|
||||||
$pScopeLogs->setScope($pInstrumentationScope);
|
$pScopeLogs->setScope($pInstrumentationScope);
|
||||||
|
$pScopeLogs->setSchemaUrl((string) $instrumentationScope->getSchemaUrl());
|
||||||
|
|
||||||
return $pScopeLogs;
|
return $pScopeLogs;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue