def process_log_config_change(self): self.global_default_level = self.get_global_config() self.loglevel = string_to_int( self.get_component_config(self.global_default_level)) current_log_hash = hash(self.loglevel) if LogController.active_log_hash != current_log_hash: LogController.active_log_hash = current_log_hash update_logging(LogController.instance_id, None, verbosity_adjust=self.loglevel)
def startup_components(self): try: self.log.info('starting-internal-components', consul=self.args.consul, etcd=self.args.etcd) registry.register('main', self) # Update the logger to output the vcore id. self.log = update_logging(instance_id=self.instance_id, vcore_id=None) yield registry.register( 'kafka_cluster_proxy', KafkaProxy(self.args.consul, self.args.kafka_cluster, config=self.config.get('kafka-cluster-proxy', {}))).start() config = self._get_adapter_config() self.core_proxy = CoreProxy( kafka_proxy=None, core_topic=self.core_topic, my_listening_topic=self.listening_topic) self.adapter_proxy = AdapterProxy( kafka_proxy=None, core_topic=self.core_topic, my_listening_topic=self.listening_topic) self.adapter = AdtranOltAdapter(core_proxy=self.core_proxy, adapter_proxy=self.adapter_proxy, config=config) adtran_request_handler = AdapterRequestFacade(adapter=self.adapter) yield registry.register( 'kafka_adapter_proxy', IKafkaMessagingProxy( kafka_host_port=self.args.kafka_adapter, # TODO: Add KV Store object reference kv_store=self.args.backend, default_topic=self.args.name, group_id_prefix=self.args.instance_id, # Needs to assign a real class target_cls=adtran_request_handler)).start() self.core_proxy.kafka_proxy = get_messaging_proxy() self.adapter_proxy.kafka_proxy = get_messaging_proxy() # retry for ever res = yield self._register_with_core(-1) self.log.info('started-internal-services') except Exception as e: self.log.exception('Failure-to-start-all-components', e=e)
def process_log_config_change(self): self.log.debug("Processing log config change") global_default_level = yield self.get_global_loglevel() level = yield self.get_component_loglevel(global_default_level) level_int = string_to_int(str(level, 'utf-8')) current_log_level = level_int if LogController.active_log_level != current_log_level: LogController.active_log_level = current_log_level self.log.debug("Applying updated loglevel") update_logging(LogController.instance_id, None, verbosity_adjust=level_int) else: self.log.debug("Loglevel not updated")
def startup_components(self): try: self.log.info('starting-internal-components', consul=self.args.consul, etcd=self.args.etcd) registry.register('main', self) # Update the logger to output the vcore id. self.log = update_logging(instance_id=self.instance_id, vcore_id=None) yield registry.register( 'kafka_cluster_proxy', KafkaProxy(self.args.consul, self.args.kafka_cluster, config=self.config.get('kafka-cluster-proxy', {}))).start() Probe.kafka_cluster_proxy_running = True Probe.kafka_proxy_faulty = False config = self._get_adapter_config() self.core_proxy = CoreProxy( kafka_proxy=None, default_core_topic=self.core_topic, default_event_topic=self.event_topic, my_listening_topic=self.listening_topic) self.adapter_proxy = AdapterProxy( kafka_proxy=None, core_topic=self.core_topic, my_listening_topic=self.listening_topic) self.adapter = BrcmOpenomciOnuAdapter( core_proxy=self.core_proxy, adapter_proxy=self.adapter_proxy, config=config, build_info=self.build_info) self.adapter.start() openonu_request_handler = AdapterRequestFacade( adapter=self.adapter, core_proxy=self.core_proxy) yield registry.register( 'kafka_adapter_proxy', IKafkaMessagingProxy( kafka_host_port=self.args.kafka_adapter, # TODO: Add KV Store object reference kv_store=self.args.backend, default_topic=self.args.name, group_id_prefix=self.args.instance_id, target_cls=openonu_request_handler)).start() Probe.kafka_adapter_proxy_running = True self.core_proxy.kafka_proxy = get_messaging_proxy() self.adapter_proxy.kafka_proxy = get_messaging_proxy() # retry for ever res = yield self._register_with_core(-1) Probe.adapter_registered_with_core = True self.log.info('started-internal-services') except Exception as e: self.log.exception('Failure-to-start-all-components', e=e)