Sunday, July 30, 2017

Java Flight Recorder JFR: enable recording of exceptions

how to specify custom settings for JFR

The default settings are in C:\Program Files\Java\jre1.8.0_121\lib\jfr\default.jfc (in Windows... otherwise in JAVA_HOME/jre/lib/jfr/default.jfc in Linux.

so you can enable also the "Exceptions" event, just copy the default.jfc to /tmp/default.jfc, hack it

<event path="java/exception_throw">
      <setting name="enabled" control="">false</setting>
      <setting name="stackTrace">true</setting>

set it to true

and start the jfr with

jcmd JFR.start settings=/tmp/default.jfc

and you will smile and be happy

No comments: