Java Flight Recording Custom Exception Settings

ALTUĞ BİLGİN ALTINTAŞ
2 min readAug 5, 2022

--

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.

Problem: I see exceptions but there is no details

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:

Solution : I see exceptions details

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

File Recording Template Manager
Critical part

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.

--

--

ALTUĞ BİLGİN ALTINTAŞ
ALTUĞ BİLGİN ALTINTAŞ

Written by ALTUĞ BİLGİN ALTINTAŞ

Business Agility lover, TDD guy, clean coder, non-stop learner.

No responses yet