class MessageLoggingToggle implements ApplicationListener<ContextRefreshedEvent> {

    @Override
    public void onApplicationEvent(final ContextRefreshedEvent event) {
        PropertyDto properties = configurationAccess.getProperties();
        String messageLogging = properties.getMessageLogging();
        if (messageLogging != null && "off".equals(messageLogging)) {
            switchOffMessageLogging();
        }
    }

}