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

Implementing Json log exporter #3744

Merged
merged 5 commits into from
Oct 14, 2021
Merged

Implementing Json log exporter #3744

merged 5 commits into from
Oct 14, 2021

Conversation

ohadza
Copy link
Contributor

@ohadza ohadza commented Oct 14, 2021

I created a clean PR, for the changes that were made after this PR #3685
(And will close the non-relevant)
for the Issue: Logging POC for log4j, logback, pita

// Shouldn't happen in practice, just skip it.
continue;
}
logger.log(Level.INFO, sw.getAndClear());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will end up putting a whole lot of log lines on a single log output. I don't think that's what I'd expect to happen. I think this should only output one log per line, rather than cramming the whole json body into one line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember reading a PR from a while back that part of the intent of these loggers is that another process could parse each log line as a Resource{type} message. If that is indeed part of the intended use case of the log exporters, we shouldn't break convention.

Copy link
Member

@jack-berg jack-berg Oct 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea in general of logging exported LogRecords is cyclical when thinking about it from the perspective of application logs: an application logs a message -> an appender feeds to the otel log sink -> the log exporter logs the message in json format -> an appender feeds to the otel log sink

I think its only really practical to use one of these log exporters if you're collecting events as LogRecords rather than application logs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I see the point. We should have the equivalent of the LoggingSpanExporter that will just mirror the logs back to JUL, one per line, which can be very useful for debugging. But, of course, problematic if used with a JUL appender! Perhaps that one (which I know is not this one) should just use stdout.

@jkwatson jkwatson merged commit 9b9dcf9 into open-telemetry:main Oct 14, 2021
This was referenced Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants