Skip to content

Commit

Permalink
Some small logging issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
alesj authored and kabir committed Mar 6, 2012
1 parent b7496dc commit 6d349f1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
Expand Up @@ -25,14 +25,14 @@
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationStepHandler;
import org.jboss.as.controller.PathAddress;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;

import org.jboss.as.logging.util.LogServices;
import org.jboss.dmr.ModelNode;
import org.jboss.msc.service.AbstractServiceListener;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceRegistry;

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;

/**
* Operation responsible for disabling a logging handler.
*
Expand All @@ -56,8 +56,11 @@ public void listenerAdded(ServiceController<?> serviceController) {
serviceController.setMode(ServiceController.Mode.NEVER);
}

public void serviceStopped(ServiceController<?> serviceController) {
context.completeStep();
@Override
public void transition(ServiceController<?> serviceController, ServiceController.Transition transition) {
if (transition == ServiceController.Transition.STOPPING_to_DOWN) {
context.completeStep();
}
}
});
} else {
Expand Down
Expand Up @@ -25,14 +25,14 @@
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationStepHandler;
import org.jboss.as.controller.PathAddress;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;

import org.jboss.as.logging.util.LogServices;
import org.jboss.dmr.ModelNode;
import org.jboss.msc.service.AbstractServiceListener;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceRegistry;

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;

/**
* Operation responsible for enabling a logging handler.
*
Expand All @@ -56,8 +56,11 @@ public void listenerAdded(ServiceController<?> serviceController) {
serviceController.setMode(ServiceController.Mode.ACTIVE);
}

public void serviceStarted(ServiceController<?> serviceController) {
context.completeStep();
@Override
public void transition(ServiceController<?> serviceController, ServiceController.Transition transition) {
if (transition == ServiceController.Transition.STARTING_to_UP) {
context.completeStep();
}
}
});
} else {
Expand Down
Expand Up @@ -41,8 +41,8 @@
import java.util.logging.Handler;
import java.util.logging.Level;

import static org.jboss.as.logging.handlers.custom.PropertiesConfigurator.setProperties;
import static org.jboss.as.logging.LoggingMessages.MESSAGES;
import static org.jboss.as.logging.handlers.custom.PropertiesConfigurator.setProperties;

/**
* Service for custom handlers.
Expand Down Expand Up @@ -96,7 +96,7 @@ public synchronized void start(final StartContext context) throws StartException
throw MESSAGES.cannotAccessClass(e, className);
}
if (filter != null) handler.setFilter(filter);
formatterSpec.apply(handler);
if (formatterSpec != null) formatterSpec.apply(handler);
if (level != null) handler.setLevel(level);
try {
handler.setEncoding(encoding);
Expand Down

0 comments on commit 6d349f1

Please sign in to comment.