Skip to content

Commit

Permalink
add logging to symmetricengine about starting node
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Oct 12, 2007
1 parent 9f4cd6d commit c7f6ec5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Expand Up @@ -29,6 +29,7 @@
import org.jumpmind.symmetric.common.Constants;
import org.jumpmind.symmetric.common.PropertiesConstants;
import org.jumpmind.symmetric.config.IRuntimeConfig;
import org.jumpmind.symmetric.model.Node;
import org.jumpmind.symmetric.service.IBootstrapService;
import org.jumpmind.symmetric.service.INodeService;
import org.jumpmind.symmetric.service.IPullService;
Expand Down Expand Up @@ -107,6 +108,7 @@ private void init(ApplicationContext applicationContext) {
purgeService = (IPurgeService) applicationContext
.getBean(Constants.PURGE_SERVICE);
registerEngine();
logger.info("Initialized SymmetricDS version " + Version.VERSION);
}

/**
Expand Down Expand Up @@ -155,6 +157,14 @@ private void startJobs() {
public synchronized void start() {
if (!started) {
initDb();
Node node = nodeService.findIdentity();
if (node != null) {
logger.info("Starting registered node [group=" + node.getNodeGroupId() +
", id=" + node.getNodeId() + ", externalId=" + node.getExternalId() + "]");
} else {
logger.info("Starting unregistered node [group=" + runtimeConfig.getNodeGroupId() +
", externalId=" + runtimeConfig.getExternalId() + "]");
}
bootstrapService.register();
bootstrapService.syncTriggers();
startJobs();
Expand Down
Expand Up @@ -81,7 +81,6 @@ public class BootstrapService extends AbstractService implements IBootstrapServi
private String insertIntoDataEventSql;

public void init() {
logger.info("SymmetricDS version " + Version.VERSION);
this.randomSleepTimeSlot = new RandomTimeSlot(this.runtimeConfiguration, 60);
if (autoConfigureDatabase) {
logger.info("Initializing symmetric database.");
Expand Down Expand Up @@ -187,7 +186,7 @@ public void register() {
// If we cannot contact the server to register, we simply must wait and try again.
while (!registered) {
try {
logger.info("Attempting to register.");
logger.info("Attempting to register with " + runtimeConfiguration.getRegistrationUrl());
registered = dataLoaderService.loadData(transportManager.getRegisterTransport(new Node(
this.runtimeConfiguration, dbDialect)));
} catch (ConnectException e) {
Expand All @@ -199,7 +198,12 @@ public void register() {
if (!registered) {
sleepBeforeRegistrationRetry();
} else {
logger.info("Successfully registered.");
node = nodeService.findIdentity();
if (node != null) {
logger.info("Successfully registered node [id=" + node.getNodeId() + "]");
} else {
logger.error("Node registration is unavailable");
}
}
}
} else {
Expand Down

0 comments on commit c7f6ec5

Please sign in to comment.