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

Introduce JSON logging #2348

Closed
wants to merge 2 commits into from
Closed

Conversation

dmlloyd
Copy link
Member

@dmlloyd dmlloyd commented May 6, 2019

Fixes #1847

@dmlloyd
Copy link
Member Author

dmlloyd commented May 6, 2019

So here's an interesting speed bump. If I want to enable JSON logging, I need the JSONP libraries. However we definitely don't want them if it's not going to be enabled.

Should we always fold in the JSON libraries? Or, should we allow an incomplete class path in this case?

@dmlloyd
Copy link
Member Author

dmlloyd commented May 6, 2019

Alternatively I could introduce an entire extension mechanism for formatter type, and then we'd have a quarkus-logging-json extension. It'd be a bit funny though given we don't have a quarkus-logging extension.

@dmlloyd
Copy link
Member Author

dmlloyd commented May 6, 2019

For now I've just added the JSON library as a core dependency.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

I added an important question inline. Could you take a look?

@@ -43,6 +43,10 @@
<groupId>io.smallrye</groupId>
<artifactId>smallrye-config</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

I can't say I'm excited to add a dependency to javax JSON in the core.I have another question: does it work for a native executable? I would have expected the quarkus-jsonp extension to be necessary.

If so, it makes the case of a specific extension IMHO.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seemed to work. But yeah maybe a specific extension is warranted.

Copy link
Contributor

Choose a reason for hiding this comment

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

For the record - quarkus-jsonp only registers org.glassfish.json.JsonProviderImpl for reflection so that javax.json.spi.JsonProvider could instantiate the class.

@mkouba
Copy link
Contributor

mkouba commented May 16, 2019

org.glassfish:javax.json is quite small so I wouldn't probably mind adding it to the core as it could be useful. On the other hand, if we decide to include this in the core we should probably remove the quarkus-jsonp extension and move the JsonpProcessor logic to the core.

@aloubyansky
Copy link
Member

@dmlloyd do you want me to merge this and create an issue for the dedicated extension? Or other preference?

@dmlloyd
Copy link
Member Author

dmlloyd commented May 17, 2019

I think it should be reworked to be a separate extension. I just haven't gotten around to it yet. If you want, we can close the PR for now to reduce clutter, and I'll reopen it if/when it's ready.

@stuartwdouglas
Copy link
Member

I think this should definitely be a seperate extension. We don't want to introduce any additional core dependencies unless we absolutely have to.

@cescoffier
Copy link
Member

@dmlloyd Should we close this PR and get some fresh start around a separate extension?

@dmlloyd
Copy link
Member Author

dmlloyd commented Jun 5, 2019

Sure.

@dmlloyd dmlloyd closed this Jun 5, 2019
@cescoffier
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add JsonFormatter support for the log
8 participants