use of org.apache.qpid.server.logging.MessageLogger in project qpid-broker-j by apache.
the class SystemLauncher method startupImpl.
private void startupImpl(Map<String, Object> systemConfigAttributes) throws Exception {
populateSystemPropertiesFromDefaults((String) systemConfigAttributes.get(SystemConfig.INITIAL_SYSTEM_PROPERTIES_LOCATION));
String storeType = (String) systemConfigAttributes.get(SystemConfig.TYPE);
// Create the RootLogger to be used during broker operation
boolean statusUpdatesEnabled = Boolean.parseBoolean(System.getProperty(SystemConfig.PROPERTY_STATUS_UPDATES, "true"));
MessageLogger messageLogger = new LoggingMessageLogger(statusUpdatesEnabled);
_eventLogger.setMessageLogger(messageLogger);
PluggableFactoryLoader<SystemConfigFactory> configFactoryLoader = new PluggableFactoryLoader<>(SystemConfigFactory.class);
SystemConfigFactory configFactory = configFactoryLoader.get(storeType);
if (configFactory == null) {
LOGGER.error("Unknown config store type '" + storeType + "', only the following types are supported: " + configFactoryLoader.getSupportedTypes());
throw new IllegalArgumentException("Unknown config store type '" + storeType + "', only the following types are supported: " + configFactoryLoader.getSupportedTypes());
}
_taskExecutor.start();
_systemConfig = configFactory.newInstance(_taskExecutor, _eventLogger, _systemPrincipal, systemConfigAttributes);
_systemConfig.setOnContainerResolveTask(new Runnable() {
@Override
public void run() {
_listener.onContainerResolve(_systemConfig);
}
});
_systemConfig.setOnContainerCloseTask(new Runnable() {
@Override
public void run() {
_listener.onContainerClose(_systemConfig);
}
});
_systemConfig.open();
if (_systemConfig.getContainer().getState() == State.ERRORED) {
throw new RuntimeException("Closing due to errors");
}
}
use of org.apache.qpid.server.logging.MessageLogger in project qpid-broker-j by apache.
the class AbstractSystemConfig method initiateStartupLogging.
private EventLogger initiateStartupLogging() {
final EventLogger eventLogger = _eventLogger;
final EventLogger startupLogger;
if (isStartupLoggedToSystemOut()) {
// Create the composite (logging+SystemOut MessageLogger to be used during startup
MessageLogger[] messageLoggers = { new SystemOutMessageLogger(), eventLogger.getMessageLogger() };
CompositeStartupMessageLogger startupMessageLogger = new CompositeStartupMessageLogger(messageLoggers);
startupLogger = new EventLogger(startupMessageLogger);
} else {
startupLogger = eventLogger;
}
return startupLogger;
}
Aggregations