protected void doStart() throws Exception { ConfigurationAdmin configurationAdmin = getTrackedService(ConfigurationAdmin.class); if (configurationAdmin == null) { return; } int size = getInt("size", 500); String pattern = getString("pattern", "%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n"); String errorColor = getString("errorColor", "31"); String warnColor = getString("warnColor", "35"); String infoColor = getString("infoColor", "36"); String debugColor = getString("debugColor", "39"); String traceColor = getString("traceColor", "39"); LogEventFormatterImpl formatter = new LogEventFormatterImpl(); formatter.setPattern(pattern); formatter.setColor(PaxLogger.LEVEL_ERROR, errorColor); formatter.setColor(PaxLogger.LEVEL_WARNING, warnColor); formatter.setColor(PaxLogger.LEVEL_INFO, infoColor); formatter.setColor(PaxLogger.LEVEL_DEBUG, debugColor); formatter.setColor(PaxLogger.LEVEL_TRACE, traceColor); register(LogEventFormatter.class, formatter); LogServiceImpl logService = new LogServiceImpl(configurationAdmin, size); Hashtable<String, Object> props = new Hashtable<>(); props.put("org.ops4j.pax.logging.appender.name", "VmLogAppender"); register(PaxAppender.class, logService, props); register(LogService.class, logService); LogMBeanImpl securityMBean = new LogMBeanImpl(logService); registerMBean(securityMBean, "type=log"); }