use of co.cask.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class RemoteSystemOperationsService method startUp.
@Override
protected void startUp() throws Exception {
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.REMOTE_SYSTEM_OPERATION));
LOG.info("Starting RemoteSystemOperationService...");
httpService.startAndWait();
cancellable = discoveryService.register(ResolvingDiscoverable.of(new Discoverable(Constants.Service.REMOTE_SYSTEM_OPERATION, httpService.getBindAddress())));
LOG.info("RemoteSystemOperationService started successfully on {}", httpService.getBindAddress());
}
use of co.cask.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class DatasetOpExecutorService method startUp.
@Override
protected void startUp() throws Exception {
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getEntityName(), Constants.Logging.COMPONENT_NAME, Constants.Service.DATASET_EXECUTOR));
LOG.info("Starting DatasetOpExecutorService...");
httpService.startAndWait();
cancellable = discoveryService.register(ResolvingDiscoverable.of(new Discoverable(Constants.Service.DATASET_EXECUTOR, httpService.getBindAddress())));
LOG.info("DatasetOpExecutorService started successfully on {}", httpService.getBindAddress());
}
use of co.cask.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class DefaultPreviewRunner method startUp.
@Override
protected void startUp() throws Exception {
if (messagingService instanceof Service) {
((Service) messagingService).startAndWait();
}
datasetService.startAndWait();
// It is recommended to initialize log appender after datasetService is started,
// since log appender instantiates a dataset.
logAppenderInitializer.initialize();
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.PREVIEW_HTTP));
Futures.allAsList(applicationLifecycleService.start(), systemArtifactLoader.start(), programRuntimeService.start(), programLifecycleService.start(), metricsCollectionService.start()).get();
}
use of co.cask.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.startAndWait();
cancellable = discoveryService.register(ResolvingDiscoverable.of(new Discoverable(Constants.Service.LOGSAVER, httpService.getBindAddress())));
}
use of co.cask.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class MetricsTwillRunnable method doInit.
@Override
protected Injector doInit(TwillContext context) {
// Set the hostname of the machine so that cConf can be used to start internal services
getCConfiguration().set(Constants.Metrics.ADDRESS, context.getHost().getCanonicalHostName());
LOG.info("{} Setting host name to {}", name, context.getHost().getCanonicalHostName());
String txClientId = String.format("cdap.service.%s.%d", Constants.Service.METRICS, context.getInstanceId());
injector = createGuiceInjector(getCConfiguration(), getConfiguration(), txClientId);
injector.getInstance(LogAppenderInitializer.class).initialize();
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS));
return injector;
}
Aggregations