-
Notifications
You must be signed in to change notification settings - Fork 34
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
Comments
Thanks for the issue, this is easy to fix, as you have it sorted out maybe you want to propose a PR? |
Hi @loicmathieu - I'm happy to have a go at this one, given that it looks like just a few additional lines. |
Great! Thank you! |
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). |
Fixed by #679 |
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 thecom.google.cloud.logging.Severity
enum, and in native builds this always serializes tonull
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 theLoggingBuildSteps
class).The text was updated successfully, but these errors were encountered: