[jboss-jira] [JBoss JIRA] (WFLY-1712) Erroneous name attribute on root-logger after add-handler operation
James Perkins (JIRA)
jira-events at lists.jboss.org
Tue Oct 29 12:36:02 EDT 2013
[ https://issues.jboss.org/browse/WFLY-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12825588#comment-12825588 ]
James Perkins commented on WFLY-1712:
-------------------------------------
The name is added in the {{validateAndSet}} which should be assigning to the model. This should likely happen on a new model and the runtime needs a way to get the correct handler name to set or just use the {{setHandlers()}}, but needs to also include any previous handlers.
{code:java}
static final OperationStepHandler ADD_HANDLER = new LoggerUpdateOperationStepHandler() {
@Override
public void updateModel(final ModelNode operation, final ModelNode model) throws OperationFailedException {
HANDLER_NAME.validateAndSet(operation, model);
model.get(HANDLERS.getName()).add(operation.get(HANDLER_NAME.getName()));
}
@Override
public void performRuntime(final OperationContext context, final ModelNode operation, final LoggerConfiguration configuration, final String name, final ModelNode model) throws OperationFailedException {
// Get the handler name
final String handlerName = HANDLER_NAME.resolveModelAttribute(context, model).asString();
final String loggerName = getLogManagerLoggerName(name);
if (configuration.getHandlerNames().contains(handlerName)) {
throw createOperationFailure(LoggingMessages.MESSAGES.handlerAlreadyDefined(handlerName));
}
LoggingLogger.ROOT_LOGGER.tracef("Adding handler '%s' to logger '%s' at '%s'", handlerName, getLogManagerLoggerName(loggerName), LoggingOperations.getAddress(operation));
configuration.addHandlerName(handlerName);
}
};
{code}
> Erroneous name attribute on root-logger after add-handler operation
> --------------------------------------------------------------------
>
> Key: WFLY-1712
> URL: https://issues.jboss.org/browse/WFLY-1712
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Logging
> Reporter: James Perkins
> Assignee: James Perkins
> Priority: Minor
>
> Execution of the {{add-handler}} operation adds a name attribute with the handlers name to the root-logger model.
> {code}
> "root-logger" => {"ROOT" => {
> "filter" => undefined,
> "filter-spec" => undefined,
> "handlers" => [
> "FILE",
> "CONSOLE"
> ],
> "level" => "INFO",
> "name" => "CONSOLE"
> }}
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list