Liferay provide default logging functionality, So you can instantiate your Log4j Log object through LogFactory, identified by the current class name, then enable the log category on the control panels "Log level" settings tab.
Following steps help you to logging :
Step 1: Inside your class variable declarations use this:
private static Log log = LogFactory.getLog(name-of-class.class);
Step 2:Then down 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!");
0 Comment(s)