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

Register Severity enum for reflection to support native applications that use gcp logging #678

Closed
wabrit opened this issue Sep 24, 2024 · 5 comments

Comments

@wabrit
Copy link
Contributor

wabrit commented Sep 24, 2024

I'm using version 2.11.0 of the quarkus-google-cloud-logging quarkiverse extension so that I can log to GCP.

Logging works as expected for non-native Quarkus applications, but in native all logs appear with DEFAULT severity in GCP console rather than INFO, DBUG etc.

This is because the LoggingHandler#transform method uses Gson to serialize a value of the com.google.cloud.logging.Severity enum, and in native builds this always serializes to null unless that class is registered for reflection.

Rather than rely on applications to do this, the quarkus google cloud logging extension should ensure that the enum is registered with ReflectiveClassBuildItem in the processor (presumably as a @BuildStep annotated method of the LoggingBuildSteps class).

@loicmathieu
Copy link
Collaborator

Thanks for the issue, this is easy to fix, as you have it sorted out maybe you want to propose a PR?
Otherwise I'll take care of it.

@wabrit
Copy link
Contributor Author

wabrit commented Sep 24, 2024

Hi @loicmathieu - I'm happy to have a go at this one, given that it looks like just a few additional lines.

@loicmathieu
Copy link
Collaborator

Great! Thank you!

@wabrit
Copy link
Contributor Author

wabrit commented Sep 24, 2024

Pull request submitted - apologies I wasn't sure how (or whether) I should do things like assigning the issue to me, link the branch/PR to this issue (or vice-versa).

@loicmathieu
Copy link
Collaborator

Fixed by #679

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

No branches or pull requests

2 participants