/ Published in: Java
This is especially useful to have appear in logs. While it is totally up to the JVM implementation what to return for the name, most seem to return a numeric process identifier.
- String pid = ManagementFactory.getRuntimeMXBean().getName();
- log.info("Foo started: pid = " + pid);
You need to login to post a comment.