set schemaUrl for logs output (#1071)

This commit is contained in:
Brett McBride 2023-07-11 09:26:40 +10:00 committed by GitHub
parent cc92a07eac
commit 3246ca8e4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,7 @@ $loggerProvider = new LoggerProvider(
(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');
$record = (new LogRecord(['foo' => 'bar', 'baz' => 'bat', 'msg' => 'hello world']))

View File

@ -110,6 +110,7 @@ class LogsConverter
$this->setAttributes($pInstrumentationScope, $instrumentationScope->getAttributes());
$pInstrumentationScope->setDroppedAttributesCount($instrumentationScope->getAttributes()->getDroppedAttributesCount());
$pScopeLogs->setScope($pInstrumentationScope);
$pScopeLogs->setSchemaUrl((string) $instrumentationScope->getSchemaUrl());
return $pScopeLogs;
}