View SLS logs in IntelliJ IDEA

Updated at:

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

Procedure

  1. Open your project in IntelliJ IDEA.

  2. In the IntelliJ IDEA menu bar, choose Tools > Alibaba Cloud > Preferences....

  3. 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.

  4. 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.

  5. 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.