Good logging is an invaluable tool for debugging and diagnosing your applications. No logging makes that job harder, but not as hard as bad logging. Logging that doesn't log useful information, that doesn't help highlight the flow of the application, etc.
Volker was trying to track down a bug that was only raising its head in production, but the log files were spammed with nothing more than "echo
". Millions and millions of log lines that were just that. A quick CTRL+F through the code later, and the offending method was found:
public int getEcho(){
System.out.println("echo");
return 1;
}
This was clearly some sort of sanity check method, a heartbeat or something. It was almost certainly added early, and never meant to actually end up in production. Like so much code that was never meant to end up in production, though, this did. And for years, it'd been churning away, "echo"ing into the night. Other developers had looked at the logs. Other developers had seen the echo. No one had bothered to fix the problem, however.
Worse, this method was only called in one place: an overloaded toString
method in the base class for all the application's domain objects. Nearly every object got converted to a string at some point, because an important job of the application was to convert collections of domain objects into lovely HTML emails. That simple description, I suspect, conceals a lot of other WTFs.