This documentation is for WSO2 API Manager 2.0.0 View documentation for the latest release.
Analyzing Logs with the Log Analyzer - API Manager 2.0.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

Follow the procedure below to view reports in WSO2 Log Analyzer.

  1. Start the WSO2 Analytics - APIM server. Then start the WSO2 API Manager server by running one of the following commands from the <APIM Analytics_Home>/bin directory. 

    • On Windows:  wso2server.bat --run
    • On Linux/Mac OS:  sh wso2server.sh

    To update the Log Analyzer with the most recent information, execute APIM_LOGANALYZER_SCRIPT script as follows. This script is automatically run every 15 minutes.

    1. Log into the Analytics - APIM Management Console using the https://<Host_Name>:<ANALYTICS-APIM_Port_Name>/carbon/ URL.
    2. In the Main tab, click Scripts to open the Available Analytics Scripts page.
    3. Click Execute for the APIM_LOGANALYZER_SCRIPT script.
  2. Access the WSO2 API Manager Admin Portal using the https://<Host_Name>:<Port_Name>/admin URL. Log into the portal using your credentials.
  3. In the left navigator, click Log Analyzer to expand the Log Analyzer section. Then click on one of the following depending on the information you want to view.

    • LIVE LOG VIEWER: To view logs that are currently being generated. For more information about how to use the gadgets in this page, see Viewing Live Logs.
    • OVERVIEW: To view the overall statistics for each log category generated. For more information about how to use the gadgets in this page, see Analyzing the Log Overview.
    • APPLICATION ERRORS: To view detailed information about different categories of errors that have occurred. For more information about how to use the gadgets in this page, see Analyzing Application Errors.
    • API DEPLOYMENT STATS: To view overall statistics relating to all the APIs that are deployed in WSO2 API Manager. For more information about how to use the gadgets in this page, see Analyzing API Deployment Statistics.
    • LOGIN ERRORS: To view overall statistics for login errors that have occurred for your WSO2 API Manager installation. For more information about how to use the gadgets in this page, see Analyzing Login Errors.
    • NUMBER OF API FAILURES: To view statistics relating to instances where the APIs deployed in your WSO2 API Manager installation have failed. For more information about how to use the gadgets in this page, see Analyzing the Number of API Failures.
    • ACCESS TOKEN ERRORS: To view detailed statistics relating to access token errors. For more information about how to use the gadgets in this page, see Analyzing Access Token Errors.

Configuring Log Analyzer for reverse proxy enabled admin portal

If you have enabled a reverse proxy for admin portal of API Manager, follow the below additional steps to configure Log Analyzer.

  1. Configure API Manager to work with reverse proxy as described in Adding a Reverse Proxy Server

    Documentation describe how to apply reverse proxy to store and publisher applications. You can follow the same for admin portal(not WSO2 carbon management console) also.

  2. Add two entries in your Load Balancer level for portal and shindig apps. Example Nginx configuration is shown below. 

    Note that, at the moment you have to use a context with no prefixes/suffixes as mapping for these two apps. These entries are internal but needed for functionality of admin portal.

    Location /portal {
             index index.html;
              proxy_set_header X-Forwarded-Host $host;
              proxy_set_header X-Forwarded-Server $host;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_pass https://localhost:9443/portal;
              proxy_redirect  https://localhost:9443/portal  https://myhost/portal;
              proxy_cookie_path /portal /portal;
    
         }


  3. Navigate to API Manager node where you are accessing admin portal and open file <APIM_HOME>/repository/deployment/server/jaggeryapps/portal/store/carbon.super/fs/gadget/gadget-commons/js/gadget-utils.js file.

  4. Comment out the following line.

    { name: "APIM", svrUrl: "https://"+location.hostname +":"+ location.port +"/admin/modules/la/log-analyzer-proxy.jag"}
  5. Add a new line representing reverse proxy URL for admin portal which replaces location.hostname +":"+ location.port in above commented out line.

    If your admin portal URL is https://myhost/apimanager/admin after applying reverse proxy new line would look like below.

    { name: "APIM", svrUrl: "https://myhost/apimanager/admin/modules/la/log-analyzer-proxy.jag"}
  6. Final configuration will look like below.

    //{ name: "APIM", svrUrl: "https://"+location.hostname +":"+ location.port +"/admin/modules/la/log-analyzer-proxy.jag"}
    { name: "APIM", svrUrl: "https://myhost/apimanager/admin/modules/la/log-analyzer-proxy.jag"}
  7. In the same APIM instance, open up <APIM_HOME>/repository/deployment/server/webapps/shindig/WEB-INF/web.xml and navigate to following section.

    <context-param>
           <param-name>system.properties</param-name>
           <param-value>
               <![CDATA[
           shindig.host=
           shindig.port=
           aKey=/shindig/gadgets/proxy?container=default&url=]]>
           </param-value>
    </context-param>

    Here you have to set values as per your load balancer configuartion as shindig.host and shindig.port. Enter Server hostname as host and server HTTPS port as port

    If you use the same load balancer configuration used in this documentation, resulting configuration will look like below.

    <context-param>
           <param-name>system.properties</param-name>
           <param-value>
               <![CDATA[
           shindig.host=myhost
           shindig.port=443
           aKey=/shindig/gadgets/proxy?container=default&url=
        ]]>
           </param-value>
    </context-param>
  8. Save the configurations and start up API Manager.

  • No labels