Package ch.qos.logback.classic

Examples of ch.qos.logback.classic.Logger


        p.put(ITConfigAdminSupport.LOGBACK_FILE,absolutePath("test-osg-appender-ref-config.xml"));
        config.update(p);

        delay();

        Logger ref = (Logger)LoggerFactory.getLogger("foo.ref.osgi");
        assertTrue(ref.isDebugEnabled());

        TestAppender ta = registerAppender("foo.bar", "foo.baz");
        delay();

        Logger bar = (Logger)LoggerFactory.getLogger("foo.bar");
        bar.setLevel(Level.DEBUG);
        Logger baz = (Logger)LoggerFactory.getLogger("foo.baz");
        baz.setLevel(Level.INFO);

        bar.debug("Test message");
        baz.debug("Test message"); // Would not be logged

        ref.debug("Test message ref");

        // One event should be logged.
        assertEquals(2, ta.events.size());
View Full Code Here


    Bundle testedBundle;

    @Configuration
    public Option[] config() throws IOException {
        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
        root.setLevel(Level.DEBUG);

        return options(
                cleanCaches(),
                ipojoBundles(),
                junitBundles(),
View Full Code Here

    private OSGiHelper helper;


    @Configuration
    public Option[] configure() throws IOException {
        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
        root.setLevel(Level.INFO);

        String providerWithMetadata = providerWithMetadata();
        String providerWithMetadataInMetaInf = providerWithMetadataInMetaInf();
        String providerWithoutMetadata = providerWithoutMetadata();
        String consumerWithMetadata = consumerWithMetadata();
View Full Code Here

    return debugConfig;
  }

  protected CompositeOption packInitialConfig() {
    Logger root = (Logger) LoggerFactory
        .getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
    root.setLevel(Level.WARN);


    String logpath = "file:" + PathUtils.getBaseDir() + "/log/logback.xml";
    //File log = new File(logpath);
//
View Full Code Here

        );
    }

    @Configuration
    public Option[] config() throws IOException {
        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
        root.setLevel(Level.DEBUG);

        return options(
                cleanCaches(),
                ipojoBundles(),
                junitBundles(),
View Full Code Here

    // encoder.start();

    // appender.setLayout(new PatternLayout("%d [%t] %-5p %c %x - %m%n"));
    appender.start();

    Logger logbackLogger = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME);
    logbackLogger.addAppender(appender);
  }
View Full Code Here

            return result;
        }

        public boolean setLogLevel(final String name, final SyncopeLoggerLevel level) {
            LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
            Logger logger = lc.getLogger(name);
            if (logger != null) {
                logger.setLevel(level.getLevel());
            }

            return logger != null;
        }
View Full Code Here

            throw new IllegalArgumentException("Cannot read from test bundle file " + testBundle
                    + " specified in the " + TESTBUNDLE_FILE + " system property");
        }
       
        // Reduce pax exam log level.
        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
        root.setLevel(Level.WARN);

        final Option[] base = options(
                workingDirectory("target/paxexam/"),
                systemProperty("dm.runtime.log").value("false"),
                systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN"),
View Full Code Here

    Bundle testedBundle;

    @Configuration
    public Option[] config() throws IOException {
        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
        root.setLevel(Level.DEBUG);

        return options(
                cleanCaches(),
                ipojoBundles(),
                junitBundles(),
View Full Code Here

public class RunLogback implements IPerfTestRunner {

  @Override
  public void runThroughputTest(int lines, Histogram histogram) {
    long s1 = System.nanoTime();
    Logger logger = (Logger) LoggerFactory.getLogger(getClass());
    for (int j = 0; j < lines; j++) {
      logger.info(THROUGHPUT_MSG);
    }
    long s2 = System.nanoTime();
    long opsPerSec = (1000L * 1000L * 1000L * lines) / (s2 - s1);
    histogram.addObservation(opsPerSec);
  }
View Full Code Here

TOP

Related Classes of ch.qos.logback.classic.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.