View SLS logs in IntelliJ IDEA
If you have purchased Alibaba Cloud Simple Log Service (SLS), you can use Cloud Toolkit to view SLS logs directly in IntelliJ IDEA. This topic describes the procedure.
Prerequisites
You have activated Simple Log Service. For more information, see Activate Simple Log Service.
You have installed and configured Cloud Toolkit in IntelliJ IDEA. For more information, see Install and configure Cloud Toolkit in IntelliJ IDEA.
Procedure
Open your project in IntelliJ IDEA.
In the IntelliJ IDEA menu bar, choose Tools > Alibaba Cloud > Preferences....
On the Preferences > Alibaba Cloud Toolkit > Accounts page, configure the AccessKey pair (AK and SK) for the account that has Simple Log Service activated, and then click OK.
On the tab bar at the bottom of IntelliJ IDEA, choose Alibaba Cloud View > Alibaba Cloud SLS. Select the Region, Project, and LogStore that contain your logs. Double-click an entry in the table or click the View button to open the log viewer.
In the LOG tab that opens, enter the query and analysis conditions and specify a time range. Click the Query/Analyze button to view the log results. You can access various helper features from the toolbars on the left and right of the table or by right-clicking a table item.
Location |
Feature |
Description |
Left toolbar |
Open in Editor |
Opens all loaded logs in the editor. |
Left toolbar |
Real-time Refresh |
Queries logs at regular intervals. |
Left toolbar |
Filter Internal Fields |
Filters out fields that start with an underscore (_) from the log output. |
Left toolbar |
Scroll to Top |
Scrolls the table to the top. |
Left toolbar |
Scroll to Bottom |
You can scroll to the bottom of the table to load more. |
Right-click a table item |
View Context |
Views logs from a specific time range before and after the current log entry. |
Right-click a table item |
Open in Editor |
Opens the current log entry in the editor. |
Right toolbar |
Open in Editor |
Opens the current log entry in the editor. |