As WaveMaker is a distributed application, each microservice generates its logs in its own container. These logs are very important to analyze or fix any issue in the Platform.
Traditionally, you should to do the following to access the log statements.
- Obtain remote server access.
- Know the required details to connect to the server
- Access the container
- Open the application logs file using a CLI text editor
- Search for the required log statements using the basic string search provided by the CLI text editor.
It gets more and more difficult if the logs are supposed to be shared with someone else or if you want to check the logs which have been generated a couple of days ago.
Kibana solves all these problems by making the logs easily accessible. One can also easily share the logs across the team with a single URL. The logs are also secure as they can only be accessed by authenticated users.
For more information, see Kibana's Opensource repository.
Kibana is purely used for the logs generated by the Platform. Application logs generated by the apps developed in WaveMaker are never pushed to Kibana.
How to access Kibana
After the WaveMaker login, open the Launchpad and click the dial icon located on the top left as shown below.
In the dial menu, click the "logs" button as shown below.
It opens the Kibana home page. The home page should look like the below image.
To search for logs using Kibana, click on the "Discover" button located in the left navigation bar.
Finally, you should see the following screen.
UseCaseOne: Accessing Specific MicroService log( Developer-Cloud) from Kibana.
- Select Discover from the Kibana and add the Filter by selecting log_file_name as edn-services.
- Below screenshot displays the searched filter results of edn-services.
UseCaseTwo: Accessing all Microservices log from the Kibana Dashboard.
- From the Kibana,Click on the Dashboard and Select MicroServiceLogs which is a Predefined Dashboard in Kibana .
- Below screenshot displays logs of all the available microservices.
Data is pixelated for privacy reasons.
The "Discover" page is where you will be able to filter through all the logs.
The required logs can be searched by applying appropriate filters. The below tables list out the most frequently used filters.
Application log filters
|Get the logs printed in the user context by using the user login ID|
|The log statements printed by a java class|
|The local IP of the machine from which the logs are collected|
|The log level used for printing the log statement|
|The actual log statement||can be any string|
|The Platform microservice name|
|The logs belonging to a particular java thread id|
Similarly, the Access logs are also pushed to Elasticsearch, they can be also be filtered using the below filters.
Access log filters
|The request method of access logs|
|HTTP request Type|
|The URI of the backend API call|
|The URL of the backend API call|
|The IP of the client who made the API call|
.keyword suffix mentioned in all the above filters is optional. Adding it will just help in auto-suggestion.
Apart from the filters mentioned above, Kibana supports many more filters, but the above should be more than sufficient in most cases.
How to apply filters
Now that we know the filters which can be applied, let us check how to apply these filters in the below example.
Let's say we want to filter the message of the
INFO log statements from all the log statements generated by the platform.
In the Kibana's Discover page, click the "Add a filter" button on the top left.
log-level.keywordas the filter type.
isas the operation.
INFOin the value field.
But, as we want to check the messages, we can add that as a field by doing the following.
Click the "add" button beside the "message" label as shown in the below image.
Finally, this is what it should look like.
Some Common Usecases
- Accessing Specific MicroService logs from Kibana.
Select Discover from the Kibana and add the Filter by selecting tag.keyword , a drop down with the list of microservices is displayed, select the microservice ex:lbaccess log and save to apply the filter.
Similarly Filter can be applied to other services like Login,EDN-Services,Developer-Cloud,Studio,Launchpad etc.
- Fetching logs based on the Status Code.