use of org.apache.qpid.server.logging.SystemOutMessageLogger in project qpid-broker-j by apache.
the class SystemLauncher method startup.
public void startup(final Map<String, Object> systemConfigAttributes) throws Exception {
final SystemOutMessageLogger systemOutMessageLogger = new SystemOutMessageLogger();
_eventLogger = new EventLogger(systemOutMessageLogger);
Subject.doAs(_brokerTaskSubject, new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
_listener.beforeStartup();
try {
startupImpl(systemConfigAttributes);
} catch (RuntimeException e) {
systemOutMessageLogger.message(new SystemStartupMessage(e));
LOGGER.error("Exception during startup", e);
_listener.errorOnStartup(e);
closeSystemConfigAndCleanUp();
} finally {
_listener.afterStartup();
}
return null;
}
});
}
use of org.apache.qpid.server.logging.SystemOutMessageLogger 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