<PackageReference Include="OpenTelemetry.Api" Version="1.12.0" />

OpenTelemetry.Logs.LogRecordAttributeList

public struct Enumerator : IEnumerator<KeyValuePair<string, object>>, IDisposable, IEnumerator

Enumerates the elements of a LogRecordAttributeList.

public int Count { get; }

public KeyValuePair<string, object> this[int index] { get; set; }

public static LogRecordAttributeList CreateFromEnumerable(IEnumerable<KeyValuePair<string, object>> attributes)

Create a LogRecordAttributeList collection from an enumerable.

public void Add(string key, object value)

Add an attribute.

public void Add(KeyValuePair<string, object> attribute)

Add an attribute.

public void Clear()

Removes all elements from the LogRecordAttributeList.

Returns an enumerator that iterates through the LogRecordAttributeList.

public void RecordException(Exception exception)

Adds attributes representing an Exception to the list.