Log error info as below:
try {
invokeRomoteB();
} catch (Exception e){
LOGGER.error("invoke B with exception!", e);
}
This will print error message and stack trace. We can find the cause easily.
But in high QPS situation, this will print lots of same stack info with huge CPU uses when many same exceptions occurred.
I find JDK can omit stack trace after same exception is thrown several times for built-in exceptions: JDK5.0 Release Notes.
Is it possible to omit stack trace (or limit frequency) after same common exception is thrown many times?
Reference: