Say you catch an exception and get the following on the standard output (like, say, the console) if you do a e.printStackTrace() :
java.io.FileNotFo
this would be good log4j error/exception logging - readable by splunk/other logging/monitoring s/w. everything is form of key-value pair.
log4j would get the stack trace from Exception obj e
try {
---
---
} catch (Exception e) {
log.error("api_name={} method={} _message=\"error description.\" msg={}",
new Object[]{"api_name", "method_name", e.getMessage(), e});
}