Package org.wso2.carbon.logging.view.ui
Class LogViewerClient
- java.lang.Object
-
- org.wso2.carbon.logging.view.ui.LogViewerClient
-
public class LogViewerClient extends Object
This class serve requests coming from log view JSP pages.
-
-
Field Summary
Fields Modifier and Type Field Description org.wso2.carbon.logging.view.stub.LogViewerStubstub
-
Constructor Summary
Constructors Constructor Description LogViewerClient(String cookie, String backendServerURL, org.apache.axis2.context.ConfigurationContext configCtx)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearLogs()Clear all the logs in the buffer.DataHandlerdownloadArchivedLogFiles(String logFile)voiddownloadArchivedLogFiles(String logFile, javax.servlet.http.HttpServletResponse response)Download log file with a given name.List<LogEvent>getAllLogs()Take all the log events from buffer for the current tenant id.String[]getApplicationNames()This method will return tha application names can be found in logs.StringgetImageName(String type)This method will return the matching image url for a given log level.PaginatedLogFileInfogetLocalLogFiles(int pageNumber, String tenantDomain, String serverKey)Get paginated list of log files in the repository/logs folder.String[]getLogLevels()This method will return all supported log levels.PaginatedLogEventgetPaginatedApplicationLogEvents(int pageNumber, String type, String keyword, String applicationName)This method will return logs filtered by a given application name.PaginatedLogEventgetPaginatedLogEvents(int pageNumber, String type, String keyword)Get paginated log events filtered by type and search keyword.String[]getServiceNames()booleanisManager()static booleanisValidTenant()Check whether the current tenant is valid.
-
-
-
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()
-
getServiceNames
public String[] getServiceNames() throws LogViewerException
- Throws:
LogViewerException
-
getLogLevels
public String[] getLogLevels()
This method will return all supported log levels.- Returns:
- log levels as an array.
-
downloadArchivedLogFiles
public DataHandler downloadArchivedLogFiles(String logFile) throws LogViewerException
- Throws:
LogViewerException
-
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.
-
-