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

Properly escape log message additions #43019

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Conversation

dmlloyd
Copy link
Member

@dmlloyd dmlloyd commented Sep 4, 2024

Also ensure that the proper format style is preserved. Avoids various NPE, IAE, etc. exceptions when rendering log messages that have been decorated.

/cc @gsmet

Fixes #43021

Also ensure that the proper format style is preserved. Avoids various NPE, IAE, etc. exceptions when rendering log messages that have been decorated.
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.

Tested it and it works a lot better.

@geoand geoand merged commit a4559dd into quarkusio:main Sep 5, 2024
52 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Sep 5, 2024
@gsmet
Copy link
Member

gsmet commented Sep 6, 2024

@dmlloyd I stumbled upon one funky issue here: if you log the exception twice, you will add the information twice.

I understand it's not your typical thing but I wonder if we should add a marker that we already added the parameter to the record?

@dmlloyd dmlloyd deleted the fix-log-fmt branch September 6, 2024 13:53
@dmlloyd
Copy link
Member Author

dmlloyd commented Sep 6, 2024

TBH this shouldn't be done in this way at all. Manipulating the log record at some random time is incorrect for exactly this reason - it could be used by many formatters, serialized, etc.

Maybe this would be better done as a filter on the root logger?

@dmlloyd
Copy link
Member Author

dmlloyd commented Sep 6, 2024

The best solution would be to support this in the logmanager itself via something in the Formatter API perhaps.

@gsmet gsmet modified the milestones: 3.16 - main, 3.14.3 Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Decorated stacktrace that is added to the log record is not properly decorated
3 participants