-
Notifications
You must be signed in to change notification settings - Fork 467
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
[WFCORE-6843] Logging a WARN if a deployment's runtime name doesn't have an extension #6340
base: main
Are you sure you want to change the base?
Conversation
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.
Thank you for your very quick response and sorry for the late response, I overlooked that. I will look at it now. Thanks for the information. :) |
2f2cb16
to
ac61cc4
Compare
/** | ||
* A logger with the category of {@code org.jboss.as.server.deployment.warning}. | ||
* <strong>Usage:</strong> Use this in code related to deployment's warnings | ||
*/ | ||
ServerLogger DEPLOYMENT_WARN_LOGGER = Logger.getMessageLogger(MethodHandles.lookup(), ServerLogger.class, "org.jboss.as.server.deployment.warning"); | ||
|
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.
We should not create specific root loggers for specific levels. We create root loggers and then we configure the levels from outside, for example in a logger configuration file.
In this file there is already a logger for deployment, use it instead.
/** | ||
* A logger with the category of {@code org.jboss.as.domain.controller.operations.deployment.warning}. | ||
* <strong>Usage:</strong> Use this in code related to deployment's warnings | ||
*/ | ||
DomainControllerLogger DEPLOYMENT_WARN_LOGGER = Logger.getMessageLogger(MethodHandles.lookup(), DomainControllerLogger.class, "org.jboss.as.domain.controller.operations.deployment.warning"); | ||
|
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.
We should not create specific root loggers for specific levels. We create root loggers and then we configure the levels from outside, for example in a logger configuration file.
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.
I understand, I just wasn't sure how to implement this correctly since the description of the issue was talking about using distinct logger for this. So, can I just use the ROOT_LOGGER for the domain and DEPLOYMENT_LOGGER for the standalone @yersan ?
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.
I just wasn't sure how to implement this correctly since the description of the issue was talking about using distinct logger for this
... and I did not properly read the Jira description :(
Got it, it was requested to use a different logger so users can turn off the logger under demand.
In such a case, I would suggest using the following (for sure open to any other idea for the name):
"org.jboss.as.server.deployment.runtime.namecheck"
"org.jboss.as.domain.controller.operations.deployment.runtime.namecheck"
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.
Sounds great to me, thank you.
First I thought, that this logger could have name so it could be reused for other deployment warnings in the future, but now I realized that it could be tricky to decide when to turn off the warning I am implementing now if the logger would be associated with another warnings with different meaning.
So, I will change also the name DEPLOYMENT_WARN_LOGGER to maybe DEPLOYMENT_NAMECHECK_LOGGER? I am also open to ideas.
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.
DEPLOYMENT_NAMECHECK_LOGGER is ok, variable name is not an issue, if you read it and identify its meaning, that's ok
@@ -94,6 +95,9 @@ static void validateRuntimeNames(String deploymentName, OperationContext context | |||
Resource root = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); | |||
ModelNode domainDeployment = root.getChild(PathElement.pathElement(DEPLOYMENT, deploymentName)).getModel(); | |||
String runtimeName = getRuntimeName(deploymentName, deployment, domainDeployment); | |||
if (!runtimeName.contains(".")) { | |||
DEPLOYMENT_WARN_LOGGER.deploymentsRuntimeNameWithoutExtension(deploymentName, runtimeName); |
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.
Use DomainControllerLogger.ROOT_LOGGER
here instead.
Core -> WildFly Preview Integration Build 14381 outcome was FAILURE using a merge of ac61cc4 Failed tests
|
ac61cc4
to
dac24f1
Compare
Core -> Full Integration Build 14591 outcome was FAILURE using a merge of dac24f1 Failed tests
|
Issue: https://issues.redhat.com/browse/WFCORE-6843