Overview

The actions  "Log errors of this method" and "Log errors of this class" automatically generate logger statements in all catch blocks of the method or class. 

It works exactly like the logger insertions when skipping the "Method Start" and "Method Exit" in the Preferences:Positions.

When choosing the option "Log all variables available" (in Preferences:Positions) it is a powerful method to log unexpected errors very quickly.

Example:

Before:

public String myMethod(String theString, int theInt) {
	String myStr = null;

//Your code....
try {
doSomethingVeryDangerous();
} catch (Exception myexception) {
return null;
} return toString();
}

After:

public String myMethod(String theString, int theInt) {
	String myStr = null;

//Your code....
try {
doSomethingVeryDangerous();
} catch (Exception myexception) {
logger.error("myMethod() - myStr=" + myStr, myexception);

return null;
}
return toString();

}
Joomla templates by a4joomla