diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..485dee6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.idea
diff --git a/Dockerfile.synchronizer b/Dockerfile.synchronizer
index b4fe6d7..be1eb0c 100644
--- a/Dockerfile.synchronizer
+++ b/Dockerfile.synchronizer
@@ -12,6 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# docker build -t xosproject/vtn-synchronizer:candidate -f Dockerfile.synchronizer .
+
 # xosproject/vtn-synchronizer
 
 FROM xosproject/xos-synchronizer-base:candidate
diff --git a/xos/synchronizer/steps/sync_onos_netcfg.py b/xos/synchronizer/steps/sync_onos_netcfg.py
index ba254be..e56892a 100644
--- a/xos/synchronizer/steps/sync_onos_netcfg.py
+++ b/xos/synchronizer/steps/sync_onos_netcfg.py
@@ -23,9 +23,10 @@
 from synchronizers.new_base.syncstep import DeferredException
 from synchronizers.new_base.syncstep import SyncStep
 from synchronizers.new_base.modelaccessor import *
-from xos.logger import Logger, logging
+from xosconfig import Config
+from multistructlog import create_logger
 
-logger = Logger(level=logging.INFO)
+log = create_logger(Config().get('logging'))
 
 class SyncONOSNetcfg(SyncStep):
     provides=[VTNService]
@@ -37,7 +38,7 @@
         SyncStep.__init__(self, **args)
 
     def handle_watched_object(self, o):
-        logger.info("handle_watched_object is invoked for object %s" % (str(o)),extra=o.tologdict())
+        log.info("handle_watched_object is invoked for object %s" % (str(o)),extra=o.tologdict())
         if (type(o) is Node): # For Node add/delete/modify
             self.call()
         if (type(o) is AddressPool): # For public gateways
@@ -54,19 +55,22 @@
         return service_instances
 
     def save_service_instance_attribute(self, service_instance, name, value):
+
+        vtn_onos_app = [si for si in service_instance.eastbound_service_instances if "ONOSApp" in si.leaf_model.class_names][0]
+
         # returns True if something changed
         something_changed=False
-        tas = ServiceInstanceAttribute.objects.filter(service_instance_id=service_instance.id, name=name)
+        tas = ServiceInstanceAttribute.objects.filter(service_instance_id=vtn_onos_app.id, name=name)
         if tas:
             ta = tas[0]
             if ta.value != value:
-                logger.info("updating %s with attribute" % name)
+                log.info("updating %s with attribute" % name)
                 ta.value = value
                 ta.save(update_fields=["value", "updated"], always_update_timestamp=True)
                 something_changed = True
         else:
-            logger.info("saving autogenerated config %s" % name)
-            ta = model_accessor.create_obj(ServiceInstanceAttribute, service_instance=service_instance, name=name, value=value)
+            log.info("saving autogenerated config %s" % name)
+            ta = model_accessor.create_obj(ServiceInstanceAttribute, service_instance=vtn_onos_app, name=name, value=value)
             ta.save()
             something_changed = True
         return something_changed
@@ -139,7 +143,7 @@
             try:
                 nodeip = socket.gethostbyname(node.name)
             except socket.gaierror:
-                logger.warn("unable to resolve hostname %s: node will not be added to config"
+                log.warn("unable to resolve hostname %s: node will not be added to config"
                             % node.name)
                 continue
 
@@ -148,7 +152,7 @@
                 dataPlaneIntf = node.dataPlaneIntf
                 dataPlaneIp = node.dataPlaneIp
             except:
-                logger.error("not adding node %s to the VTN configuration" % node.name)
+                log.error("not adding node %s to the VTN configuration" % node.name)
                 continue
 
             node_dict = {
@@ -174,7 +178,7 @@
         # Pull the gateway information from Address Pool objects
         for ap in AddressPool.objects.all():
             if (not ap.gateway_ip) or (not ap.gateway_mac):
-                logger.info("Gateway_ip or gateway_mac is blank for addresspool %s. Skipping." % ap)
+                log.info("Gateway_ip or gateway_mac is blank for addresspool %s. Skipping." % ap)
                 continue
 
             gateway_dict = {
@@ -184,7 +188,7 @@
             data["apps"]["org.opencord.vtn"]["cordvtn"]["publicGateways"].append(gateway_dict)
 
         if not AddressPool.objects.all().exists():
-            logger.info("No Address Pools present, not adding publicGateways to config")
+            log.info("No Address Pools present, not adding publicGateways to config")
 
         return json.dumps(data, indent=4, sort_keys=True)
 
@@ -203,7 +207,7 @@
 
         service_instances = self.get_service_instances_who_want_config()
         for service_instance in service_instances:
-            something_changed = self.save_service_instance_attribute(service_instance, "rest_onos/v1/network/configuration/", netcfg)
+            something_changed = self.save_service_instance_attribute(service_instance, "onos/v1/network/configuration/", netcfg)
             if (something_changed):
                 # make sure we cause the ServiceInstance to be updated as well as the attribute
                 # TODO: revisit this after synchronizer multi-object-watching is complete
