Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marshal log record as JSON #5500

Open
corentinmusard opened this issue Jun 10, 2024 · 1 comment
Open

Marshal log record as JSON #5500

corentinmusard opened this issue Jun 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@corentinmusard
Copy link

Problem Statement

I want to write log record to a file in JSON format, is there any way to do it?

I saw in #5172 (comment) that this feature has been postponed.

Proposed Solution

Export this method: func (e *Exporter) newRecordJSON(r sdklog.Record) recordJSON

@corentinmusard corentinmusard added the enhancement New feature or request label Jun 10, 2024
@pellared
Copy link
Member

This is not a stable JSON representation. See https://pkg.go.dev/go.opentelemetry.io/otel/exporters/stdout/stdoutlog#pkg-overview:

it does not provide an interchange format for OpenTelemetry that is supported with any stability or compatibility guarantees

However, it is possible we could provide such functionality as part of otlplogfile package. Reference:

@pellared pellared changed the title Marshall log record as JSON Marshal log record as JSON Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants