Search in sources :

Example 1 with SystemOutMessageLogger

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;
        }
    });
}
Also used : SystemOutMessageLogger(org.apache.qpid.server.logging.SystemOutMessageLogger) EventLogger(org.apache.qpid.server.logging.EventLogger) TimeoutException(java.util.concurrent.TimeoutException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) ExecutionException(java.util.concurrent.ExecutionException)

Example 2 with SystemOutMessageLogger

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;
}
Also used : EventLogger(org.apache.qpid.server.logging.EventLogger) CompositeStartupMessageLogger(org.apache.qpid.server.logging.CompositeStartupMessageLogger) SystemOutMessageLogger(org.apache.qpid.server.logging.SystemOutMessageLogger) MessageLogger(org.apache.qpid.server.logging.MessageLogger) SystemOutMessageLogger(org.apache.qpid.server.logging.SystemOutMessageLogger) CompositeStartupMessageLogger(org.apache.qpid.server.logging.CompositeStartupMessageLogger)

Aggregations

EventLogger (org.apache.qpid.server.logging.EventLogger)2 SystemOutMessageLogger (org.apache.qpid.server.logging.SystemOutMessageLogger)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1 CompositeStartupMessageLogger (org.apache.qpid.server.logging.CompositeStartupMessageLogger)1 MessageLogger (org.apache.qpid.server.logging.MessageLogger)1