Skip to content

Add scope (if exists) to exported logs #20659

@tamir-michaeli

Description

@tamir-michaeli

Component(s)

exporter/logzio

Is your feature request related to a problem? Please describe.

When using OpentelemetryAppender for log4j2 with the collector, originating class and package are missing from the logs.
Example when log exported to a file (using fileexporter):

"scopeLogs":
[
    {
        "scope":
        {
            "name": "my.package.MyClass"
        },
        "logRecords":
        [
            {
                "timeUnixNano": "1679392848655807000",
                "severityNumber": 5,
                "severityText": "DEBUG",
                "body":
                {
                    "stringValue": "nice logging message"
                },
                "flags": 1,
                "traceId": "6a902c1bdbf3761f3584f0e54ca4592f",
                "spanId": "ec2349124b1d1449"
            }
        ]
    }
]

When the log is exported using logzioexporter, the scope copied into the log.

Describe the solution you'd like

Adding a scope to exported logs, if such scope exists.

Describe alternatives you've considered

Transform Processor, but it cannot be used in this case since the scope is in a different context than the log.

Additional context

I will work on this one :)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions