It's useful to print VM arguments to the log file, especially when you are logging several JVM invocations:
$ java -cp foo -Xlog:gc:file=a.log -Xcomp com.Foo
$ java -cp foo -Xlog:gc:file=b.log -Xint com.Foo
After a while, you may forget which process created a.log and which created b.log. Adding vm arguments into the log file will help distinguishing them:
$ java -cp foo -Xlog:gc,arguments:file=a.log -Xcomp com.Foo
$ java -cp foo -Xlog:gc,arguments:file=b.log -Xint com.Foo
$ grep jvm_args a.log b.log
a.log:[0.015s][info][arguments] jvm_args: -Xlog:gc,arguments:file=a.log -Xint
b.log:[0.001s][info][arguments] jvm_args: -Xlog:gc,arguments:file=b.log -Xcomp
======================
Here's an example of what the log looks like:
$ java -Xlog:arguments -Xshare:on -cp ~/tmp -Dxx=yy -esa HelloWorld 1 2 3
[0.001s][info][arguments] VM Arguments:
[0.001s][info][arguments] jvm_args: -Xlog:arguments -Xshare:on -Dxx=yy -esa
[0.001s][info][arguments] java_command: HelloWorld 1 2 3
[0.001s][info][arguments] java_class_path (initial): /home/user/tmp
[0.001s][info][arguments] Launcher Type: SUN_STANDARD
Hello World
$ java -cp foo -Xlog:gc:file=a.log -Xcomp com.Foo
$ java -cp foo -Xlog:gc:file=b.log -Xint com.Foo
After a while, you may forget which process created a.log and which created b.log. Adding vm arguments into the log file will help distinguishing them:
$ java -cp foo -Xlog:gc,arguments:file=a.log -Xcomp com.Foo
$ java -cp foo -Xlog:gc,arguments:file=b.log -Xint com.Foo
$ grep jvm_args a.log b.log
a.log:[0.015s][info][arguments] jvm_args: -Xlog:gc,arguments:file=a.log -Xint
b.log:[0.001s][info][arguments] jvm_args: -Xlog:gc,arguments:file=b.log -Xcomp
======================
Here's an example of what the log looks like:
$ java -Xlog:arguments -Xshare:on -cp ~/tmp -Dxx=yy -esa HelloWorld 1 2 3
[0.001s][info][arguments] VM Arguments:
[0.001s][info][arguments] jvm_args: -Xlog:arguments -Xshare:on -Dxx=yy -esa
[0.001s][info][arguments] java_command: HelloWorld 1 2 3
[0.001s][info][arguments] java_class_path (initial): /home/user/tmp
[0.001s][info][arguments] Launcher Type: SUN_STANDARD
Hello World