private void SetFromEnvironment()

in src/Elastic.OpenTelemetry.Core/Configuration/CompositeElasticOpenTelemetryOptions.cs [327:343]


	private void SetFromEnvironment<T>(string key, ConfigCell<T> field, Func<string?, T?> parser)
	{
		var safeValue = GetSafeEnvironmentVariable(key);

		// 'Trace' does not exist in OTEL_LOG_LEVEL ensure we parse it to next granularity
		// debug, NOTE that OpenTelemetry treats this as invalid and will parse to 'Information'
		// We treat 'Debug' and 'Trace' as a signal global file logging should be enabled.
		if (key.Equals("OTEL_LOG_LEVEL") && safeValue.Equals("trace", StringComparison.OrdinalIgnoreCase))
			safeValue = "debug";

		var value = parser(safeValue);

		if (value is null)
			return;

		field.Assign(value, ConfigSource.Environment);
	}