Search in sources :

Example 1 with ProcessInfo

use of org.infinispan.commons.jdkspecific.ProcessInfo in project infinispan by infinispan.

the class Bootstrap method logJVMInformation.

private void logJVMInformation() {
    Logger logger = Logger.getLogger("BOOT");
    logger.info("JVM " + System.getProperty("java.vm.name") + " " + System.getProperty("java.vm.vendor") + " " + System.getProperty("java.vm.version"));
    ProcessInfo process = ProcessInfo.getInstance();
    logger.info("JVM arguments = " + process.getArguments());
    logger.info("PID = " + process.getPid());
    if (logger.isLoggable(Level.FINE)) {
        StringBuilder sb = new StringBuilder("Classpath JARs:" + System.lineSeparator());
        URLClassLoader cl = (URLClassLoader) this.getClass().getClassLoader();
        for (URL url : cl.getURLs()) {
            sb.append("    ").append(url).append(System.lineSeparator());
        }
        logger.fine(sb.toString());
        sb = new StringBuilder("System properties:" + System.lineSeparator());
        for (Map.Entry<Object, Object> p : System.getProperties().entrySet()) {
            sb.append("    ").append(p.getKey()).append('=').append(p.getValue()).append(System.lineSeparator());
        }
        logger.fine(sb.toString());
    }
}
Also used : URLClassLoader(java.net.URLClassLoader) ProcessInfo(org.infinispan.commons.jdkspecific.ProcessInfo) Logger(java.util.logging.Logger) Map(java.util.Map) URL(java.net.URL)

Aggregations

URL (java.net.URL)1 URLClassLoader (java.net.URLClassLoader)1 Map (java.util.Map)1 Logger (java.util.logging.Logger)1 ProcessInfo (org.infinispan.commons.jdkspecific.ProcessInfo)1