Java Flight Recording Custom Exception Settings
Java Flight Recording is an excellent tool for diagnosing abnormalities in production. The overhead of JFR is very minimal.
The problem is that when I start JFR in default mode, you can not see the details of the exceptions.
As you can see in the above screenshot, I can see that there are lots of errors, but I can’t see what they exactly are. After the setup, I am able to see the details of the exception types:
My current setup condition is like, I use Java 11, JDK Mission Control 8. Let’s deep dive into how I see the details of the exceptions.
Step 1 : Start the application that you want to monitor with JFR.
Step 2 : Customize Java Flight configuration file.
Open Java Mission Control app
Open Window > File Recording Template Manager
Open default jfc file under Java_Home\lib\jfr\profile.jfc
Step 3 : Use the jcmd command to attach the application for monitoring.
jcmd 23060 JFR.start name=2022–07–26 settings=D:\dir\profile_err.jfc delay=10s duration=2m filename=C:\TEMP\2022–07–26.jfr
That’s all folks.