"My team has recently inherited a massive monster of a Java J2EE based system," writes Terence White, "some of the code leaves me to wonder if the reason these guys had no peer review was that they had no peers."

"One thing they were obsessed with was logging. And logging their logging. It's no wonder why the system required a handful of servers for a few dozen users..."

public class AuthenticationService {

    static Log log = LogFactory.getLogger(AuthenticationService.class);

    public void authenticateUser(String userName, String password) {
        
        System.out.println("Fetching trust token");

        // snip few lines of code

        System.out.println("Trust token is being processed - Success");
    
        try {
            System.out.println("Attempting to log");
            log.debug("Logging a message");
            System.out.println("Logging");
        } catch (Exception ex) {
            ex.printStackTrace();
        }

    }

}