From: Michal Rehak Date: Tue, 20 May 2014 15:57:18 +0000 (+0200) Subject: BUG-1051: logback configuration loader proposal X-Git-Tag: release/helium~715^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=bca2f0e1c9d47e42b43811097891034528355fc5 BUG-1051: logback configuration loader proposal - uses environment variable logback.config.d (pointing to config root folder) - removes previously loaded logging configuration - applies all config files from config root folder in alphabetical order - requires: - to be added to osgi.bundles (configuration.ini) - existing logback.config.d variable (configuration.ini) - logback config files in specified config root folder - added overloads for load method - enriched util class protection against "accidental" instantiation - using precompiled pattern while iterating folder content - added classcast protection for case when the logging backend differs from logback Change-Id: Id0242c78fe39b9631d1a4bca66d9674f7a3fec62 Signed-off-by: Michal Rehak --- diff --git a/opendaylight/config/logback-config-loader/pom.xml b/opendaylight/config/logback-config-loader/pom.xml new file mode 100644 index 0000000000..03ff65f662 --- /dev/null +++ b/opendaylight/config/logback-config-loader/pom.xml @@ -0,0 +1,53 @@ + + + + 4.0.0 + + org.opendaylight.controller + config-plugin-parent + 0.2.5-SNAPSHOT + ../config-plugin-parent + + logback-config-loader + bundle + ${project.artifactId} + + 3.0.4 + + + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + org.slf4j + slf4j-api + + + + + junit + junit + test + + + + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.logback.config.loader.Activator + + + + + + diff --git a/opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/Activator.java b/opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/Activator.java new file mode 100644 index 0000000000..99866d5767 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/Activator.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader; + +import java.io.File; +import java.util.List; + +import org.opendaylight.controller.logback.config.loader.impl.LogbackConfigUtil; +import org.opendaylight.controller.logback.config.loader.impl.LogbackConfigurationLoader; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * default activator for loading multiple logback configuration files + */ +public class Activator implements BundleActivator { + + /** + * expected environment variable name, containing the root folder containing + * logback configurations + */ + private static final String LOGBACK_CONFIG_D = "logback.config.d"; + private static Logger LOG = LoggerFactory.getLogger(Activator.class); + + @Override + public void start(BundleContext context) { + LOG.info("Starting logback configuration loader"); + String logbackConfigRoot = System.getProperty(LOGBACK_CONFIG_D); + LOG.debug("configRoot: {}", logbackConfigRoot); + if (logbackConfigRoot != null) { + File logbackConfigRootFile = new File(logbackConfigRoot); + List sortedConfigFiles = LogbackConfigUtil.harvestSortedConfigFiles(logbackConfigRootFile); + LogbackConfigurationLoader.load(true, sortedConfigFiles.toArray()); + } + } + + @Override + public void stop(BundleContext context) { + LOG.info("Stopping logback configuration loader"); + // TODO: need reset/reload default config? + } + +} diff --git a/opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigUtil.java b/opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigUtil.java new file mode 100644 index 0000000000..ddf14d7dd3 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigUtil.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader.impl; + +import java.io.File; +import java.io.FileFilter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * logback config utils + */ +public final class LogbackConfigUtil { + + /** logback config file pattern (*.xml) */ + protected static final String LOGBACK_CONFIG_FILE_REGEX_SEED = ".+\\.xml"; + private static final Logger LOG = LoggerFactory + .getLogger(LogbackConfigUtil.class); + + /** + * forbidden ctor + */ + private LogbackConfigUtil() { + throw new UnsupportedOperationException(); + } + + /** + * @param logConfigRoot folder containing configuration files + * @return sorted list of found files + */ + public static List harvestSortedConfigFiles(File logConfigRoot) { + final Pattern xmlFilePattern = Pattern.compile(LOGBACK_CONFIG_FILE_REGEX_SEED); + File[] configs = logConfigRoot.listFiles(new FileFilter() { + @Override + public boolean accept(File pathname) { + return pathname.isFile() + && xmlFilePattern.matcher(pathname.getName()).find(); + } + }); + + List sortedConfigFiles = new ArrayList(configs.length); + for (File cfgItem : configs) { + LOG.trace("config: {}", cfgItem.toURI()); + sortedConfigFiles.add(cfgItem); + } + Collections.sort(sortedConfigFiles); + + return sortedConfigFiles; + } + +} diff --git a/opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigurationLoader.java b/opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigurationLoader.java new file mode 100644 index 0000000000..2aa6b1a348 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigurationLoader.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) 201 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader.impl; + +import java.io.File; +import java.net.URL; + +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ch.qos.logback.classic.LoggerContext; +import ch.qos.logback.classic.joran.JoranConfigurator; +import ch.qos.logback.core.joran.spi.JoranException; +import ch.qos.logback.core.util.StatusPrinter; + +/** + * Logback configuration loader. + * Strategy: + *
    + *
  1. reset actual configuration (probably default configuration)
  2. + *
  3. load all given logback config xml files in given order
  4. + *
+ */ +public final class LogbackConfigurationLoader { + + private static final Logger LOG = LoggerFactory + .getLogger(LogbackConfigurationLoader.class); + + /** + * forbidden ctor + */ + private LogbackConfigurationLoader() { + throw new UnsupportedOperationException(); + } + + /** + * load given logback configurations in given order, reset existing configuration before applying first one + * @param purgeBefore require reset before loading first config + * @param args + */ + public static void load(boolean purgeBefore, Object...args) { + try { + if (purgeBefore) { + resetExistingConfiguration(); + } + for (Object logbackConfig : args) { + load(logbackConfig); + } + } catch (IllegalStateException e) { + LOG.warn("loading of multiple logback configurations failed", e); + } + } + + /** + * purge existing logback configuration + */ + public static void resetExistingConfiguration() { + LOG.trace("resetting existing logback configuration"); + LoggerContext context = getLoggerContext(); + JoranConfigurator configurator = new JoranConfigurator(); + configurator.setContext(context); + context.reset(); + } + + /** + * @return logback context + */ + private static LoggerContext getLoggerContext() { + ILoggerFactory context = LoggerFactory.getILoggerFactory(); + if (context != null && context instanceof LoggerContext) { + // now SLF4J is bound to logback in the current environment + return (LoggerContext) context; + } + throw new IllegalStateException("current logger factory is not supported: " + context); + } + + /** + * @param logbackConfig + * @param reset true if previous configuration needs to get purged + */ + public static void load(Object logbackConfig) { + LOG.trace("BEFORE logback reconfig"); + try { + LoggerContext context = getLoggerContext(); + JoranConfigurator configurator = new JoranConfigurator(); + configurator.setContext(context); + if (logbackConfig instanceof String) { + configurator.doConfigure((String) logbackConfig); + } else if (logbackConfig instanceof URL) { + configurator.doConfigure((URL) logbackConfig); + } else if (logbackConfig instanceof File) { + configurator.doConfigure((File) logbackConfig); + } + + LOG.trace("applied {}", logbackConfig); + StatusPrinter.printInCaseOfErrorsOrWarnings(context); + } catch (IllegalStateException | JoranException je) { + LOG.warn("Logback configuration loading failed: {}", logbackConfig); + } + LOG.trace("AFTER logback reconfig"); + } + +} diff --git a/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/LogbackConfigurationLoaderTest.java b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/LogbackConfigurationLoaderTest.java new file mode 100644 index 0000000000..2e9bf1df00 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/LogbackConfigurationLoaderTest.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader.test; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.opendaylight.controller.logback.config.loader.impl.LogbackConfigUtil; +import org.opendaylight.controller.logback.config.loader.impl.LogbackConfigurationLoader; +import org.opendaylight.controller.logback.config.loader.test.logwork.Debugger; +import org.opendaylight.controller.logback.config.loader.test.logwork.Errorer; +import org.opendaylight.controller.logback.config.loader.test.logwork.Informer; +import org.opendaylight.controller.logback.config.loader.test.logwork.Tracer; +import org.opendaylight.controller.logback.config.loader.test.logwork.Warner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * test of logging config loader - {@link LogbackConfigurationLoader} + */ +@RunWith(JUnit4.class) +public class LogbackConfigurationLoaderTest { + + /** logback config root */ + private static final String LOGBACK_D = "/logback.d"; + private static Logger LOG = LoggerFactory + .getLogger(LogbackConfigurationLoaderTest.class); + + /** + * Test of method {@link LogbackConfigurationLoader#load(boolean, Object[])} + * + * @throws Exception + */ + @Test + public void testLoad() throws Exception { + File logConfigRoot = new File(LogbackConfigurationLoaderTest.class + .getResource(LOGBACK_D).getFile()); + List sortedConfigFiles = LogbackConfigUtil.harvestSortedConfigFiles(logConfigRoot); + LogbackConfigurationLoader.load(true, sortedConfigFiles.toArray()); + + LOG.info("LOGBACK ready -> about to use it"); + + Tracer.doSomeAction(); + Debugger.doSomeAction(); + Informer.doSomeAction(); + Warner.doSomeAction(); + Errorer.doSomeAction(); + + // check logs + String[] expectedLogs = new String[] { + "LoggingEvent -> [INFO] org.opendaylight.controller.logback.config.loader.test.LogbackConfigurationLoaderTest: LOGBACK ready -> about to use it", + "LoggingEvent -> [TRACE] org.opendaylight.controller.logback.config.loader.test.logwork.Tracer: tracing", + "LoggingEvent -> [DEBUG] org.opendaylight.controller.logback.config.loader.test.logwork.Tracer: debugging", + "LoggingEvent -> [INFO] org.opendaylight.controller.logback.config.loader.test.logwork.Tracer: infoing", + "LoggingEvent -> [WARN] org.opendaylight.controller.logback.config.loader.test.logwork.Tracer: warning", + "LoggingEvent -> [ERROR] org.opendaylight.controller.logback.config.loader.test.logwork.Tracer: erroring", + "LoggingEvent -> [DEBUG] org.opendaylight.controller.logback.config.loader.test.logwork.Debugger: debugging", + "LoggingEvent -> [INFO] org.opendaylight.controller.logback.config.loader.test.logwork.Debugger: infoing", + "LoggingEvent -> [WARN] org.opendaylight.controller.logback.config.loader.test.logwork.Debugger: warning", + "LoggingEvent -> [ERROR] org.opendaylight.controller.logback.config.loader.test.logwork.Debugger: erroring", + "LoggingEvent -> [INFO] org.opendaylight.controller.logback.config.loader.test.logwork.Informer: infoing", + "LoggingEvent -> [WARN] org.opendaylight.controller.logback.config.loader.test.logwork.Informer: warning", + "LoggingEvent -> [ERROR] org.opendaylight.controller.logback.config.loader.test.logwork.Informer: erroring", + "LoggingEvent -> [WARN] org.opendaylight.controller.logback.config.loader.test.logwork.Warner: warning", + "LoggingEvent -> [ERROR] org.opendaylight.controller.logback.config.loader.test.logwork.Warner: erroring", + "LoggingEvent -> [ERROR] org.opendaylight.controller.logback.config.loader.test.logwork.Errorer: erroring" + + }; + + List logSnapshot = new ArrayList<>(TestAppender.getLogRecord()); + for (String logLine : logSnapshot) { + LOG.info("\"{}\",", logLine); + } + + Assert.assertArrayEquals(expectedLogs, logSnapshot.toArray()); + } +} diff --git a/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/TestAppender.java b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/TestAppender.java new file mode 100644 index 0000000000..b273d2777c --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/TestAppender.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader.test; + +import java.util.ArrayList; +import java.util.List; + +import ch.qos.logback.classic.spi.LoggingEvent; +import ch.qos.logback.core.Appender; +import ch.qos.logback.core.Context; +import ch.qos.logback.core.LogbackException; +import ch.qos.logback.core.filter.Filter; +import ch.qos.logback.core.spi.FilterReply; +import ch.qos.logback.core.status.Status; + +/** + * dummy appender for collecting log messages + * + * @param + */ +public class TestAppender implements Appender { + + private boolean started; + private Context context; + private String name; + + private static List logRecord = new ArrayList<>(); + + @Override + public void start() { + started = true; + } + + @Override + public void stop() { + started = false; + } + + @Override + public boolean isStarted() { + return started; + } + + @Override + public void setContext(Context context) { + this.context = context; + } + + @Override + public Context getContext() { + return context; + } + + @Override + public void addStatus(Status status) { + // TODO Auto-generated method stub + } + + @Override + public void addInfo(String msg) { + // TODO Auto-generated method stub + } + + @Override + public void addInfo(String msg, Throwable ex) { + // TODO Auto-generated method stub + } + + @Override + public void addWarn(String msg) { + // TODO Auto-generated method stub + } + + @Override + public void addWarn(String msg, Throwable ex) { + // TODO Auto-generated method stub + } + + @Override + public void addError(String msg) { + // TODO Auto-generated method stub + } + + @Override + public void addError(String msg, Throwable ex) { + // TODO Auto-generated method stub + } + + @Override + public void addFilter(Filter newFilter) { + // TODO Auto-generated method stub + } + + @Override + public void clearAllFilters() { + // TODO Auto-generated method stub + } + + @Override + public List> getCopyOfAttachedFiltersList() { + // TODO Auto-generated method stub + return null; + } + + @Override + public FilterReply getFilterChainDecision(E event) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getName() { + return name; + } + + @Override + public void doAppend(E event) throws LogbackException { + if (event instanceof LoggingEvent) { + LoggingEvent lEvent = (LoggingEvent) event; + logRecord.add(String.format("%s -> [%s] %s: %s", event.getClass() + .getSimpleName(), lEvent.getLevel(), + lEvent.getLoggerName(), lEvent.getMessage())); + } else { + logRecord.add(event.getClass() + " -> " + event.toString()); + } + } + + @Override + public void setName(String name) { + this.name = name; + } + + /** + * @return the logRecord + */ + public static List getLogRecord() { + return logRecord; + } + +} diff --git a/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Debugger.java b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Debugger.java new file mode 100644 index 0000000000..a8052f71c9 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Debugger.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader.test.logwork; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * dummy logging guy + */ +public class Debugger { + + private static Logger LOG = LoggerFactory.getLogger(Debugger.class); + + /** + * all logging + */ + public static void doSomeAction() { + LOG.trace("tracing"); + LOG.debug("debugging"); + LOG.info("infoing"); + LOG.warn("warning"); + LOG.error("erroring"); + } + +} diff --git a/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Errorer.java b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Errorer.java new file mode 100644 index 0000000000..0bcd830ad1 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Errorer.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader.test.logwork; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * dummy logging guy + */ +public class Errorer { + + private static Logger LOG = LoggerFactory.getLogger(Errorer.class); + + /** + * all logging + */ + public static void doSomeAction() { + LOG.trace("tracing"); + LOG.debug("debugging"); + LOG.info("infoing"); + LOG.warn("warning"); + LOG.error("erroring"); + } + +} diff --git a/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Informer.java b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Informer.java new file mode 100644 index 0000000000..44f09315cf --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Informer.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader.test.logwork; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * dummy logging guy + */ +public class Informer { + + private static Logger LOG = LoggerFactory.getLogger(Informer.class); + + /** + * all logging + */ + public static void doSomeAction() { + LOG.trace("tracing"); + LOG.debug("debugging"); + LOG.info("infoing"); + LOG.warn("warning"); + LOG.error("erroring"); + } + +} diff --git a/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Tracer.java b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Tracer.java new file mode 100644 index 0000000000..70df607d8d --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Tracer.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader.test.logwork; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * dummy logging guy + */ +public class Tracer { + + private static Logger LOG = LoggerFactory.getLogger(Tracer.class); + + /** + * all logging + */ + public static void doSomeAction() { + LOG.trace("tracing"); + LOG.debug("debugging"); + LOG.info("infoing"); + LOG.warn("warning"); + LOG.error("erroring"); + } + +} diff --git a/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Warner.java b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Warner.java new file mode 100644 index 0000000000..8093180a8b --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Warner.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.logback.config.loader.test.logwork; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * dummy logging guy + */ +public class Warner { + + private static Logger LOG = LoggerFactory.getLogger(Warner.class); + + /** + * all logging + */ + public static void doSomeAction() { + LOG.trace("tracing"); + LOG.debug("debugging"); + LOG.info("infoing"); + LOG.warn("warning"); + LOG.error("erroring"); + } + +} diff --git a/opendaylight/config/logback-config-loader/src/test/resources/logback-test.xml b/opendaylight/config/logback-config-loader/src/test/resources/logback-test.xml new file mode 100755 index 0000000000..7fb760aca7 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/resources/logback-test.xml @@ -0,0 +1,17 @@ + + + + + + %date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + diff --git a/opendaylight/config/logback-config-loader/src/test/resources/logback.d/logback-alt.xml b/opendaylight/config/logback-config-loader/src/test/resources/logback.d/logback-alt.xml new file mode 100755 index 0000000000..ca489d5c78 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/resources/logback.d/logback-alt.xml @@ -0,0 +1,19 @@ + + + + + + + %date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + diff --git a/opendaylight/config/logback-config-loader/src/test/resources/logback.d/logback-alt2.xml b/opendaylight/config/logback-config-loader/src/test/resources/logback.d/logback-alt2.xml new file mode 100755 index 0000000000..89f82c5046 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/resources/logback.d/logback-alt2.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/opendaylight/config/logback-config-loader/src/test/resources/logback.d/logback-alt3.xml b/opendaylight/config/logback-config-loader/src/test/resources/logback.d/logback-alt3.xml new file mode 100755 index 0000000000..a37b6f7f21 --- /dev/null +++ b/opendaylight/config/logback-config-loader/src/test/resources/logback.d/logback-alt3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + +