use of io.cdap.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class LogSaverStatusService method startUp.
@Override
protected void startUp() throws Exception {
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.LOGSAVER));
httpService.start();
cancellable = discoveryService.register(ResolvingDiscoverable.of(URIScheme.createDiscoverable(Constants.Service.LOGSAVER, httpService)));
}
use of io.cdap.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class MetricsQueryService method startUp.
@Override
protected void startUp() throws Exception {
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS));
LOG.info("Starting Metrics Service...");
httpService.start();
LOG.info("Started Metrics HTTP Service...");
// Register the service
cancelDiscovery = discoveryService.register(ResolvingDiscoverable.of(URIScheme.createDiscoverable(Constants.Service.METRICS, httpService)));
LOG.info("Metrics Service started successfully on {}", httpService.getBindAddress());
}
use of io.cdap.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class MetricsProcessorStatusService method startUp.
@Override
protected void startUp() throws Exception {
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS_PROCESSOR));
LOG.info("Starting MetricsProcessor Status Service...");
httpService.start();
cancellable = discoveryService.register(ResolvingDiscoverable.of(URIScheme.createDiscoverable(Constants.Service.METRICS_PROCESSOR, httpService)));
LOG.info("Started MetricsProcessor Status Service.");
}
use of io.cdap.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class MessagingServiceTwillRunnable method doInit.
@Override
protected Injector doInit(TwillContext context) {
CConfiguration cConf = getCConfiguration();
cConf.set(Constants.MessagingSystem.HTTP_SERVER_BIND_ADDRESS, context.getHost().getHostName());
cConf.setInt(Constants.MessagingSystem.CONTAINER_INSTANCE_ID, context.getInstanceId());
injector = createInjector(cConf, getConfiguration());
injector.getInstance(LogAppenderInitializer.class).initialize();
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.MESSAGING_SERVICE));
return injector;
}
use of io.cdap.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class MetricsProcessorTwillRunnable method doInit.
@Override
protected Injector doInit(TwillContext context) {
getCConfiguration().set(Constants.MetricsProcessor.BIND_ADDRESS, context.getHost().getCanonicalHostName());
// Set the hostname of the machine so that cConf can be used to start internal services
LOG.info("{} Setting host name to {}", name, context.getHost().getCanonicalHostName());
instanceId = context.getInstanceId();
String txClientId = String.format("cdap.service.%s.%d", Constants.Service.METRICS_PROCESSOR, context.getInstanceId());
injector = createGuiceInjector(getCConfiguration(), getConfiguration(), txClientId, context);
injector.getInstance(LogAppenderInitializer.class).initialize();
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS_PROCESSOR));
return injector;
}
Aggregations