Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What is the default approach for logging in Liferay

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 557
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: