Package java.util.logging

Examples of java.util.logging.LogManager.reset()


      checkPropertyNull(manager);
      assertEquals(root.getHandlers()[0].getLevel(), Level.OFF);
      assertEquals(2, root.getHandlers().length);
      assertEquals(Level.ALL, root.getLevel());

      manager.reset();
      checkPropertyNull(manager);
      assertEquals(0, root.getHandlers().length);
      assertEquals(Level.INFO, root.getLevel());
      try {
        manager.readConfiguration();
View Full Code Here


      }
      checkPropertyNull(manager);
      assertEquals(1, root.getHandlers().length);
      assertEquals(Level.OFF, root.getLevel());

      manager.reset();
      checkPropertyNull(manager);
      assertEquals(0, root.getHandlers().length);
      assertEquals(Level.INFO, root.getLevel());
      try {
        manager.readConfiguration();
View Full Code Here

    @Test
    public void testQuietLogging() throws Exception {

        final List<LogRecord> logRecords = new ArrayList<LogRecord>();
        LogManager logManager = LogManager.getLogManager();
        logManager.reset();
        Handler handler = new Handler() {
            @Override
            public void publish(LogRecord record) {
                logRecords.add(record);
            }
View Full Code Here

  public static PrintStream  out      = null;

  public void initialize() throws Exception {
    LogManager logManager = LogManager.getLogManager();
    logManager.reset();

    logDir.mkdirs();

    Handler fileHandler = new FileHandler(new File(logDir, "launcher_%g.log").getPath(), 100000, 5, true);
    fileHandler.setFormatter(new ClientLoggerFormatter());
View Full Code Here

    }

    public void unregisterWebapp(ClassLoader webappClassLoader) {
        LogManager manager = logManagers.remove(webappClassLoader);
        if (manager != null) {
            manager.reset();
        }
    }

    public void registerWebapp(ClassLoader webappClassLoader) {
        final String name = webappClassLoader.toString();
View Full Code Here

    public void reset() throws SecurityException {
        LogManager logManager = getContextualLogManager();
        if (logManager == null) {
            super.reset();
        } else {
            logManager.reset();
        }
    }

}
View Full Code Here

    }

    public void unregisterClassLoader(ClassLoader contextClassLoader) {
        LogManager manager = logManagers.remove(contextClassLoader);
        if (manager != null) {
            manager.reset();
        }
    }

    public void registerClassLoader(ClassLoader contextClassLoader) {
        final String name = contextClassLoader.toString();
View Full Code Here

    public void reset() throws SecurityException {
        LogManager logManager = getContextualLogManager();
        if (logManager == null) {
            super.reset();
        } else {
            logManager.reset();
        }
    }

}
View Full Code Here

    @AfterClass
    public static void afterClass() throws Exception {
        LogManager lm = LogManager.getLogManager();
        try {
            lm.reset();
            // restoring original configuration to not use tested logging handlers
            lm.readConfiguration();
        } catch (Exception e) {
            // ignore missing config file
        }
View Full Code Here

  }
   
  public static void divertToFile() {
        // initialize logging to go to rolling log file
        LogManager logManager = LogManager.getLogManager();
        logManager.reset();

        // log file max size 10K, 3 rolling files, append-on-open
        Handler fileHandler = null;
    try {
      fileHandler = new FileHandler("console.log", 100000, 1, true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.