Preferences:Positions

Table of contents

Positions

Log4E inserts logger statements at certain method entries. You can specify the behaviour for each entry differently. The entries are separated in different tabs.

Tab Method Start

It defines the very beginning of the method. The logger statement is inserted there. If method is a constructor and does a constructor invocation (i.e. this(), super()) the logger statement is inserted right behind the invocation.

Options:

As a result the logger statements are automatically inserted like in that example:

public String myMethod(String arg1) {
	if (logger.isDebugEnabled()) {
		logger.debug("myMethod(String arg1 = " + arg1 + ") - start");
	}

	//Your code....
}

Tab Method Exit

It defines the exit point of a method. That could be a return statement or the end of the method.
Therefore a logger statement is inserted before every return statement and at the end of method.

The settings are the same as at start position except these:

Options:

Example:

Before:

public String myMethod(String arg1) {
	//Your code....

	return toString();
}

After:

public String myMethod(String arg1) {
	//Your code....

	String returnString = toString();
	logger.debug("myMethod() - end - return value = " + returnString);
	return returnString;
}

Tab Catch Block

It defines the position in a try - catch block. Normally a logger with ERROR level is inserted here providing the given exception.

The settings are the same as at start position. Some additional options are available:

Tab Other

It defines all other positions than "Method Start", "Method Exit" or "Catch Block".
This occurs when System out's are replaced at other positions or when log statements are modified at other positions or if you use the "Insert Log Statement At This Position..." task.

The settings are reduced to the needed information.