Monday, May 26, 2014

Log from Java method in WSO2 Framework

Pre-Requisites :

  Ø 
Application server should be up and running.
   Ø  Should be able to write a simple java method using eclipse.
   Ø  One should have knowledge on how to deploy the service from java methods.
   Ø  Should be able to test the service after deployment.

Steps :

    Ø Write a simple Custom Java method by following syntax.


  import org.apache.commons.logging.Log;
      import org.apache.commons.logging.LogFactory;

 private static Log eventLogger = LogFactory.getLog(HelloDH.class);

   Ø  Create a jar and deploy it in the application server (Or Any other way of deploying the java methods onto application server).

   Ø  Test and check for the logs.

o   Test the service by searching for the web service and once tested,You can check for the log as shown in the below screenshot.


You can even find the logs in file system. For ex., "
E:\Kiran\Softwares DH\WSO2\WSO2\wso2as-5.2.1\wso2as-5.2.1\repository\logs"

No comments:

Post a Comment