-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[WIP] Ability to specify log category levels through separate options #35138
base: main
Are you sure you want to change the base?
Conversation
Some questions:
Do the log category specific options take precedence over
Would |
Correct.
No, except for env vars, only
Yes but only as
Yes, there's an explicit logic for that. |
84ddbe9
to
481c7b5
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.saml.ArtifactBindingWithResolutionServiceTest#testReceiveArtifactLoginFullWithPost
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreported flaky test detected, please review
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
This reverts commit e4f539f.
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
481c7b5
to
46f5001
Compare
Signed-off-by: Václav Muzikář <[email protected]>
46f5001
to
06c101a
Compare
if (option.getKey() != null) { | ||
Matcher matcher = WILDCARD_PLACEHOLDER_PATTERN.matcher(option.getKey()); | ||
if (matcher.find()) { | ||
// Includes handling for both "--" prefix for CLI options and "kc." prefix | ||
this.optionNameWildcardPattern = Pattern.compile("(?:" ARG_PREFIX "|kc\\.)" matcher.replaceFirst("([\\\\\\\\.a-zA-Z0-9] )")); | ||
|
||
// Not using toEnvVarFormat because it would process the whole string incl the <...> wildcard. | ||
Matcher envVarMatcher = WILDCARD_PLACEHOLDER_PATTERN.matcher(option.getKey().toUpperCase().replace("-", "_")); | ||
this.envVarNameWildcardPattern = Pattern.compile("KC_" envVarMatcher.replaceFirst("([_A-Z0-9] )")); | ||
|
||
if (to != null) { | ||
toWildcardMatcher = WILDCARD_PLACEHOLDER_PATTERN.matcher(to); | ||
if (!toWildcardMatcher.find()) { | ||
throw new IllegalArgumentException("Attempted to map a wildcard option to a non-wildcard option"); | ||
} | ||
|
||
this.toWildcardPattern = Pattern.compile(toWildcardMatcher.replaceFirst("([\\\\\\\\.a-zA-Z0-9] )")); | ||
} | ||
} | ||
|
||
this.wildcardValuesTransformer = wildcardValuesTransformer; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vmuzikar From the first sight, it looks good! But I didn't have time to look at it closer, but I'm curious if SmallRye Config supports something similar that could be used. As Quarkus supports specifying the log categories or multiple named datasources, they need to have some sort of functionality already implemented.
Did you have a chance to analyze it?
Signed-off-by: Václav Muzikář <[email protected]>
Closes #34957
The majority of changes focus on adding the support for option names with wildcard, e.g.
log-level-<category>
.log-<category>-level
._
escaping. E.g.LOG_LEVEL_IO_QUARKUS=TRACE
gets mapped tolog-level-io.quarkus=TRACE
._
represents in the env var format, the wildcard does not support-
symbols, onlya-z
,0-9
and.
are generally accepted. Env vars match onlyA-Z
,0-9
and_
.What's missing and is to be done in this PR: