Package java.util.logging

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


                cmdlineLogger.addHandler(consoleHandler);
                cmdlineLogger.setUseParentHandlers(false);
            } else {
                // Do not intervene.  Use JDK logging exactly as configured by
                // user.
                lm.readConfiguration();
                // The only bad thing about doing this is that if the app has
                // programmatically changed the logging config after starting
                // the program but before using FrameworkLogger, we will
                // clobber those customizations.
            }
View Full Code Here


    this.logFile.delete();

    // initialize log framework
    LogManager logManager = LogManager.getLogManager();
    try {
      logManager.readConfiguration(ClassLoader.getSystemResourceAsStream(loggerPropertiesFileName));
    } catch (SecurityException e) {
      handleException(e);
      return;
    } catch (IOException e) {
      handleException(e);
View Full Code Here

        final ClassLoader cl = getClass().getClassLoader();
        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run () {
                try {
                    InputStream config = cl.getResourceAsStream(PROPERIES_FILE);
                    logManager.readConfiguration(config);
                    return null;
                }
                catch (IOException ex) {
                    throw new JDOFatalUserException(
                        "A IOException was thrown when trying to read the " +
View Full Code Here

        final ClassLoader cl = getClass().getClassLoader();
        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run () {
                try {
                    InputStream config = cl.getResourceAsStream(PROPERIES_FILE);
                    logManager.readConfiguration(config);
                    return null;
                }
                catch (IOException ex) {
                    throw new JDOFatalUserException(
                        "A IOException was thrown when trying to read the " +
View Full Code Here

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

    @Override
    public void readConfiguration(InputStream ins) throws IOException, SecurityException {
View Full Code Here

    public void readConfiguration(InputStream ins) throws IOException, SecurityException {
        LogManager logManager = getContextualLogManager();
        if (logManager == null) {
            super.readConfiguration(ins);
        } else {
            logManager.readConfiguration(ins);
        }
    }

    @Override
    public void removePropertyChangeListener(PropertyChangeListener l) throws SecurityException {
View Full Code Here

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

    @Override
    public void readConfiguration(InputStream ins) throws IOException, SecurityException {
View Full Code Here

    public void readConfiguration(InputStream ins) throws IOException, SecurityException {
        LogManager logManager = getContextualLogManager();
        if (logManager == null) {
            super.readConfiguration(ins);
        } else {
            logManager.readConfiguration(ins);
        }
    }

    @Override
    public void removePropertyChangeListener(PropertyChangeListener l) throws SecurityException {
View Full Code Here

        LogManager lm = LogManager.getLogManager();
        InputStream ins = JAXRSLoggingAtomPushTest.class.getResourceAsStream(propFile);
        String s = IOUtils.readStringFromStream(ins);
        ins.close();
        s = s.replaceAll("9080", PORT);
        lm.readConfiguration(new ByteArrayInputStream(s.getBytes("UTF-8")));
       
        for (Handler h : LOG.getHandlers()) {
            LOG.removeHandler(h);
            h.close();
        }
View Full Code Here

    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
        }
        if (server != null) {
            server.destroy();
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.