

One of the first messages tells us that the HotSpot virtual machine begins its work: Simply execute java -Xlog (maybe append -version to get rid of the helpful but long display of command line options) and have a look at the output - of which there is a lot. We'll look at each of them in turn, but before doing that, we can have a look at the kind of messages -Xlog produces. which output to use (for example a file).which information to include (for example time stamps and process IDs).which messages to log (by tag and/or by log level).This is the only flag regarding this mechanism - any further configuration is immediately appended to that option. Logging can be activated with the java option -Xlog.

The unified logging infrastructure is very similar to known logging frameworks The logging output can be configured according to your needs. It generates textual messages, attaches some meta information like tags (describing the originating subsystem), a log level (describing the importance of the message), and time stamps before printing them somewhere. The JVM-internal, unified logging infrastructure is very similar to known logging frameworks like Log4j or Logback that you might have used for your application.
Xlog for pet how to#
The -Xlog option can be a bit intimidating, so in this post we will master it step by step, learning how to use it to select which messages and information to show. This gives uniform access to log messages from different subsystems such as class loading, threading, the garbage collector, the module system, or the interaction with the underlying operating system. Java 9 comes with a unified logging architecture ( JEP 158) that pipes a lot of messages that the JVM generates through the same mechanism, which can be configured with the -Xlog option.
