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

Quarkus Console Logging Does Not Support UTF-8 Encoding #44247

Closed
melodyfromheaven opened this issue Nov 1, 2024 · 5 comments
Closed

Quarkus Console Logging Does Not Support UTF-8 Encoding #44247

melodyfromheaven opened this issue Nov 1, 2024 · 5 comments
Labels
area/logging kind/question Further information is requested

Comments

@melodyfromheaven
Copy link

melodyfromheaven commented Nov 1, 2024

Describe the bug

I have encountered an issue with the console logging in Quarkus. It appears that the console log does not support UTF-8 encoding, which causes problems when logging messages containing non-ASCII characters, such as Korean characters.

Relate Issues
#36919
https://stackoverflow.com/questions/78465679/when-starting-quarkus-with-quarkusdev-in-intellij-idea-the-console-displays-ch

It's 2024, and it's surprising this issue still exists. Quarkus should be better than Spring, right?

Quarkus version : 3.15.1

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@melodyfromheaven melodyfromheaven added the kind/bug Something isn't working label Nov 1, 2024
Copy link

quarkus-bot bot commented Nov 1, 2024

/cc @dmlloyd (logging)

@dmlloyd
Copy link
Member

dmlloyd commented Nov 1, 2024

Quarkus console logging does in fact support UTF-8 and any other character encoding supported by the JDK. The encoding used is the console encoding detected by the JDK. You can override that encoding by setting the stdout.encoding or native.encoding system property.

@geoand
Copy link
Contributor

geoand commented Nov 1, 2024

@dmlloyd so I assume there is nothing for us to do here?

@dmlloyd
Copy link
Member

dmlloyd commented Nov 1, 2024

I think it should work as it is, right.

@geoand geoand added kind/question Further information is requested triage/needs-feedback We are waiting for feedback. and removed kind/bug Something isn't working labels Nov 1, 2024
@geoand geoand closed this as completed Nov 7, 2024
@geoand geoand removed the triage/needs-feedback We are waiting for feedback. label Nov 7, 2024
@Kitt3120
Copy link

Kitt3120 commented Nov 11, 2024

I'd like to bring my situation into the conversation. I am currently debugging a similar issue at work.

When we updated from Quarkus 3.10.1 to 3.15.1, we noticed some weird behaviour regarding text encoding. Running our app locally works fine, but when deployed to the cluster, we get encoding issues with non UTF-8 characters. It would be fine for just our logs, but this issue also happens when using the REST client. When POSTing to an endpoint, our payload also has encoding issues.

We updated to 3.16.2 today and the problem persists.
I'll try setting the stdout.encoding or native.encoding system properties tomorrow when I am back at work.
If it doesn't fix the issue, I'll try to pin down the exact Quarkus version where this issue was introduced.

Edit:

Thanks for bringing up the stdout.encoding and file.encoding system properties. I was able to debug that our deployment was in fact using wrong encodings. We are using Red Hat's ubi8 (ubi-minimal) as our container base image. Updating from ubi-minimal 8.9-1137 to 8.10-1130 introduced the issue.

I am considering moving away from ubi8 as a fix. Quarkus micro image sounds good.

Edit 2:

We migrated to Alpine, and encoding is working now. I pinned down the issue to ubi-minimal 8.10-1088. Version 8.10-1054.1725961554 and below are fine.

I think the team should be aware of this fact. In the Quarkus docs, ubi-minimal:8.10 (and thus the newest, broken version) is recommended! See https://quarkus.io/guides/building-native-image#manually-using-the-minimal-base-image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants