O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting ready

To see all the logging possibilities at a glance, you can run the following command:

java -Xlog:help

Here is the output:

As you can see, the format of the -Xlog option is defined as follows:

-Xlog[:[what][:[output][:[decorators][:output-options]]]]

Let's explain the option in detail:

  • The what is a combination of tags and levels of the form, tag1[+tag2...][*][=level][,...]. We have already demonstrated how this construct works when we used the gc tag in the -Xlog:gc*=debug option. The wildcard (*) indicates that you'd like to see all the messages that have the gc tag (maybe among other tags). An absence of the -Xlog:gc=debug ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required