Skip to content

Allow us to set CategoryName when using the logging bridge API #5274

@AB027PS

Description

@AB027PS

Feature Request

Is your feature request related to a problem?

If I create a logger with the OtlpExporter using the bridge API and then emit a log, an exception will be thrown at line 50 here

foreach (var logRecord in logRecordBatch)
{
var otlpLogRecord = this.ToOtlpLog(logRecord);
if (otlpLogRecord != null)
{
if (!logsByCategory.TryGetValue(logRecord.CategoryName, out var scopeLogs))
{
scopeLogs = this.GetLogListFromPool(logRecord.CategoryName);
logsByCategory.Add(logRecord.CategoryName, scopeLogs);
resourceLogs.ScopeLogs.Add(scopeLogs);
}
because logRecord.CategoryName will be null. A possible workaround is to create a processor which will set CategoryName to a non-null value on each LogRecord separately, but that only prevents the exceptions and doesn't address the feature request.

Describe the solution you'd like:

Add a CategoryName property to the LogRecordData struct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions