Examples of DomConfigurator


Examples of org.apache.log4j.xml.DOMConfigurator

  }

  private void resetLogger() {
    // Force a reset on the logger's configuration
    LogManager.resetConfiguration();
    new DOMConfigurator().doConfigure(filename, LogManager.getLoggerRepository());
  }
View Full Code Here

Examples of org.apache.log4j.xml.DOMConfigurator

        if (stream == null) {
            stream = this.getClass().getResourceAsStream("/log4j.xml");
            LOG.warn("Couldn't find outside log4j configuration, using internal");
        }
        DOMConfigurator configurator = new DOMConfigurator();
        configurator.doConfigure(stream, LogManager.getLoggerRepository());
        LOG.info("Logging configured.");
    }
View Full Code Here

Examples of org.apache.log4j.xml.DOMConfigurator

   
   
    String configFile = args[4];

    if(configFile.endsWith(".xml")) {
      new DOMConfigurator().configure(configFile);
    } else {
      new PropertyConfigurator().configure(configFile);
    }
   
    new JMSSink(tcfBindingName, topicBindingName, username, password);
View Full Code Here

Examples of org.apache.log4j.xml.DOMConfigurator

      e.printStackTrace();
      usage("Could not interpret port number ["+ portStr +"].");
    }
  
    if(configFile.endsWith(".xml")) {
      new DOMConfigurator().configure(configFile);
    } else {
      new PropertyConfigurator().configure(configFile);
    }
  }
View Full Code Here

Examples of org.apache.log4j.xml.DOMConfigurator

                    if (LOG4J_PROPERTIES.equals(fileName) || LOG4J_XML.equals(fileName) || JBOSS_LOG4J_XML.equals(fileName)) {
                        final ClassLoader current = SecurityActions.getThreadContextClassLoader();
                        try {
                            SecurityActions.setThreadContextClassLoader(module.getClassLoader());
                            if (LOG4J_XML.equals(fileName) || JBOSS_LOG4J_XML.equals(fileName)) {
                                new DOMConfigurator().doConfigure(configStream, org.apache.log4j.JBossLogManagerFacade.getLoggerRepository(logContext));
                            } else {
                                final Properties properties = new Properties();
                                properties.load(new InputStreamReader(configStream, "utf-8"));
                                new org.apache.log4j.PropertyConfigurator().doConfigure(properties, org.apache.log4j.JBossLogManagerFacade.getLoggerRepository(logContext));
                            }
View Full Code Here

Examples of org.apache.log4j.xml.DOMConfigurator

    /**
     * Static method to change the Log4j config globally.
     * @param xmlConfig The text of a Log4j config file.
     */
    public static void configure(String xmlConfig) {
        DOMConfigurator configurator = new DOMConfigurator();
        StringReader sr = new StringReader(xmlConfig.trim());
        configurator.doConfigure(sr, LogManager.getLoggerRepository());
    }
View Full Code Here

Examples of org.apache.log4j.xml.DOMConfigurator

            }
            if (log4jConfigLocation.endsWith(".xml")) {
                if (log4jConfigLocation.startsWith("classpath:")) {
                    log4jConfigLocation = log4jConfigLocation.replaceFirst("classpath:", "");
                    InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(log4jConfigLocation);
                    new DOMConfigurator().doConfigure(is, LogManager.getLoggerRepository());
                } else {
                    DOMConfigurator.configureAndWatch(log4jConfigLocation);
                }
            } else if (log4jConfigLocation.endsWith(".properties")) {
                if (log4jConfigLocation.startsWith("classpath:")) {
View Full Code Here

Examples of org.apache.log4j.xml.DOMConfigurator

        } catch (IOException e) {
            log.warn("Could not determine content type from URL; ignoring", e);
        }
        if (contentType != null) {
            if (contentType.toLowerCase().endsWith("/xml")) {
                return new DOMConfigurator();
            }
        }

        // Check thr file name
        String filename = url.getFile().toLowerCase();
        if (filename.endsWith(".xml")) {
            return new DOMConfigurator();
        } else if (filename.endsWith(".properties")) {
            return new PropertyConfigurator();
        }

        // Check for <?xml in content
        if (connection != null) {
            try {
                BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                try {
                    String head = reader.readLine();
                    if (head.startsWith("<?xml")) {
                        return new DOMConfigurator();
                    }
                } finally {
                    reader.close();
                }
            } catch (IOException e) {
View Full Code Here

Examples of org.apache.log4j.xml.DOMConfigurator

            }
            if (log4jConfigLocation.endsWith(".xml")) {
                if (log4jConfigLocation.startsWith("classpath:")) {
                    log4jConfigLocation = log4jConfigLocation.replaceFirst("classpath:", "");
                    InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(log4jConfigLocation);
                    new DOMConfigurator().doConfigure(is, LogManager.getLoggerRepository());
                } else {
                    DOMConfigurator.configureAndWatch(log4jConfigLocation);
                }
            } else if (log4jConfigLocation.endsWith(".properties")) {
                if (log4jConfigLocation.startsWith("classpath:")) {
View Full Code Here

Examples of org.glassfish.admin.rest.utils.DomConfigurator

    }

   
    public static Map<String, String> getResourceLinks(List<Dom> proxyList, UriInfo uriInfo) {
        Map<String, String> links = new TreeMap<String, String>();
        Collections.sort(proxyList, new DomConfigurator());
        for (Dom proxy : proxyList) { //for each element
            try {
                links.put(
                        getKey(proxy),
                        getElementLink(uriInfo, getKey(proxy)));
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.