Configuration
in package
uses
LogsMessagesTrait
FinalYes
Table of Contents
Properties
- $configs : array<string|int, mixed>|null
- $envReader : EnvReader|null
- $file : string
- $sdkPlugin : ComponentPlugin
Methods
- create() : SdkBuilder
- getInstrumentationConfig() : ConfigProperties
- Instrumentation configuration from the `instrumentation/development` node of the same document, or an empty {@see ConfigProperties} if the node is absent.
- parseFile() : Configuration
- logDebug() : void
- logError() : void
- logInfo() : void
- logNotice() : void
- logWarning() : void
- __construct() : mixed
- doLog() : void
- Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.
- envReader() : EnvReader
- Reads the same sources, in the same order, as the SDK resolver that finds `OTEL_CONFIG_FILE`.
- envSourceProviders() : array<int, EnvSource>
- instrumentationFactory() : ConfigurationFactory<string|int, ConfigurationRegistry>
- loadComponentProviders() : iterable<string|int, mixed>
- sdkFactory() : ConfigurationFactory<string|int, SdkBuilder>
- shouldLog() : bool
Properties
$configs
private
array<string|int, mixed>|null
$configs
= null
$envReader read-only
private
EnvReader|null
$envReader
$file read-only
private
string
$file
$sdkPlugin read-only
private
ComponentPlugin
$sdkPlugin
Methods
create()
public
create([Context $context = new Context() ]) : SdkBuilder
Parameters
Return values
SdkBuildergetInstrumentationConfig()
Instrumentation configuration from the `instrumentation/development` node of the same document, or an empty {@see ConfigProperties} if the node is absent.
public
getInstrumentationConfig([Context $context = new Context() ]) : ConfigProperties
Parameters
Tags
Return values
ConfigPropertiesparseFile()
public
static parseFile(string $file[, string|null $cacheFile = null ][, bool $debug = true ][, EnvReader|null $envReader = null ]) : Configuration
Parameters
- $file : string
- $cacheFile : string|null = null
- $debug : bool = true
- $envReader : EnvReader|null = null
Return values
ConfigurationlogDebug()
protected
static logDebug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logError()
protected
static logError(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logInfo()
protected
static logInfo(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logNotice()
protected
static logNotice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logWarning()
protected
static logWarning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
__construct()
private
__construct(ComponentPlugin<string|int, SdkBuilder> $sdkPlugin, string $file, EnvReader|null $envReader[, array<string|int, mixed>|null $configs = null ]) : mixed
Parameters
- $sdkPlugin : ComponentPlugin<string|int, SdkBuilder>
- $file : string
- $envReader : EnvReader|null
- $configs : array<string|int, mixed>|null = null
-
loaded configurations, null until the file is read
doLog()
Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.
private
static doLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
- $level : string
- $message : string
- $context : array<string|int, mixed>
envReader()
Reads the same sources, in the same order, as the SDK resolver that finds `OTEL_CONFIG_FILE`.
private
static envReader(EnvReader|null $envReader) : EnvReader
Parameters
- $envReader : EnvReader|null
Return values
EnvReaderenvSourceProviders()
private
static envSourceProviders() : array<int, EnvSource>
Return values
array<int, EnvSource>instrumentationFactory()
private
static instrumentationFactory(EnvReader|null $envReader) : ConfigurationFactory<string|int, ConfigurationRegistry>
Parameters
- $envReader : EnvReader|null
Return values
ConfigurationFactory<string|int, ConfigurationRegistry>loadComponentProviders()
private
static loadComponentProviders() : iterable<string|int, mixed>
Return values
iterable<string|int, mixed>sdkFactory()
private
static sdkFactory(EnvReader|null $envReader) : ConfigurationFactory<string|int, SdkBuilder>
Parameters
- $envReader : EnvReader|null
Return values
ConfigurationFactory<string|int, SdkBuilder>shouldLog()
private
static shouldLog(string $level) : bool
Parameters
- $level : string