ErrorFile with
%p option
The product flag
—XX:ErrorFile=file can be used to specify where the error log file is created.
Where,
file represents the full path for the file location. The file variable can contain the substring
%p.
If the application uses Serial GC and a fatal error occurs, the substring
%p is expanded to process ID of the Java process.
If the application uses Parallel or CMS GC and a fatal error occurs, the substring
%p is expanded to
<Java pid>_<[Java pid| javahelper pid]>.
Where,
<Java pid> is the process ID of the Java process ID and
<javahelper pid> is the process ID of the javahelper process.
The first process ID is always the Java process ID. The second process ID is the process ID of the process that creates the error file. If the error file is created by the Java process, the second process ID is the Java process ID and if created by the javahelper process, it is the javahelper process ID. The number of error files created is equal to the number of processes in the Java process group. This is illustrated by the following examples:
When the filename is specified as
errorlog%p
java –XX:ErrorFile=errorLog%p SampleJava
where,
errorLog is the filename of the error file.
If DGC is enabled, multiple files are created with the name format:
errorLog<Java pid>_<[Java pid| javahelper pid]>
where,
<Java pid>is the Java process ID
<javahelper pid>is the process ID of the javahelper process
For error log file created by the Java process, both PIDs are Java process ID and for error log file created by the javahelper processes, the first one is the Java process ID and the second one is the javahelper process ID.
When the filename is specified as
error%p.log
java –XX:ErrorFile=error%p.log SampleJava
where,
error.log the filename of the error file.
If DGC is enabled, multiple files are created with the name format:
error<Java pid>_<[Java pid| javahelper pid]>.log
where,
<Java pid>is the Java process ID
<javahelper pid>is the process ID of the javahelper process
For error log file created by the Java process, both PIDs are Java process ID and for error log file created by the javahelper processes, the first one is the Java process ID and the second one is the javahelper process ID.

