Class LogViewerClient


  • public class LogViewerClient
    extends Object
    This class serve requests coming from log view JSP pages.
    • Field Detail

      • stub

        public org.wso2.carbon.logging.view.stub.LogViewerStub stub
    • Constructor Detail

      • LogViewerClient

        public LogViewerClient​(String cookie,
                               String backendServerURL,
                               org.apache.axis2.context.ConfigurationContext configCtx)
                        throws org.apache.axis2.AxisFault
        Throws:
        org.apache.axis2.AxisFault
    • Method Detail

      • clearLogs

        public void clearLogs()
        Clear all the logs in the buffer.
      • getAllLogs

        public List<LogEvent> getAllLogs()
        Take all the log events from buffer for the current tenant id.
        Returns:
        List of log events.
      • getApplicationNames

        public String[] getApplicationNames()
        This method will return tha application names can be found in logs.
        Returns:
        List of application names.
      • getPaginatedApplicationLogEvents

        public PaginatedLogEvent getPaginatedApplicationLogEvents​(int pageNumber,
                                                                  String type,
                                                                  String keyword,
                                                                  String applicationName)
        This method will return logs filtered by a given application name.
        Parameters:
        pageNumber - pagination page number.
        type - log level.
        keyword - search keyword.
        applicationName - application name.
        Returns:
        logEvent consist of logs filtered by an Application name.
      • getImageName

        public String getImageName​(String type)
        This method will return the matching image url for a given log level.
        Parameters:
        type - Log level.
        Returns:
        matching image location.
      • isValidTenant

        public static boolean isValidTenant()
        Check whether the current tenant is valid.
        Returns:
        validity of the current tenant.
      • getPaginatedLogEvents

        public PaginatedLogEvent getPaginatedLogEvents​(int pageNumber,
                                                       String type,
                                                       String keyword)
        Get paginated log events filtered by type and search keyword.
        Parameters:
        pageNumber - pagination page number.
        type - log level.
        keyword - search keyword.
        Returns:
        paginated log events.
      • getLocalLogFiles

        public PaginatedLogFileInfo getLocalLogFiles​(int pageNumber,
                                                     String tenantDomain,
                                                     String serverKey)
        Get paginated list of log files in the repository/logs folder.
        Parameters:
        pageNumber - page number.
        tenantDomain - tenant domain.
        serverKey - search keyword.
        Returns:
        paginated list of log files.
      • isManager

        public boolean isManager()
      • getLogLevels

        public String[] getLogLevels()
        This method will return all supported log levels.
        Returns:
        log levels as an array.
      • downloadArchivedLogFiles

        public void downloadArchivedLogFiles​(String logFile,
                                             javax.servlet.http.HttpServletResponse response)
        Download log file with a given name.
        Parameters:
        logFile - name of the log file.
        response - file download http response.