Logging is ready to work out of the box.
Inside class variable declarations, use this:
private static Log log = LogFactory.getLog(name-of-class.class);
Then in your code use this to output to the catalina.out file in liferay / tomcat / logs
log.info("Some info you want to see");
or
log.error("This error was thrown!");
source share