Locate the log file in the log folder of your servlet container (i.e. Tomcat).
As suggested using log4j to generate debugging messages. This logging structure provides a configuration file in which you can set options such as where the logs should be written or how the log messages should be formatted. Once it is in place, you can replace
System.out.println("message");
from
log.debug("your debug message");
or
log.info("in case of a message with info character"); log.error("routine foo has experienced an exception", e);
Now your code is much cleaner, and there is another advantage - when placed correctly, these logs act as documentation for your code segments.
david
source share