Skip to content

Getting around IntelliJ

The majority of the work you do with Lightrun, including troubleshooting, debugging, performance testing, and the like, is performed directly from either your IDE or the Lightrun CLI. When working from the IDE plugin, you can add Lightrun actions (logs, metrics, snapshots) from the relevant code line in the source code of your live app and then view the relevant output as well.

The rest of this article describes:

The plugin layout

Prerequisites

!!! reqs "Prerequisites" To use the plugin, make sure:

 - You've attached at least [one agent to your app](install.md) 
 - [You install the plugin](install-client.md) in your local IntelliJ instance)
 - You [authenticate IntelliJ](connectIntelliJ.md) with your Lightrun accountß
 - Make sure you have access to the server where the application with the agent is running. 
 - Be sure to open *the source code file for the running application* from the IDE.

Lightrun is part of the IntelliJ right-hand sidebar, and appears similarly to the following:

The Lightrun sidebar -quarter

This sidebar displays all the running agents and their tags, as well as the actions that have been attached to them.

Note

If these lists are completely empty or if you can only see a list of tags but not agents, the agents might all be down. Contact your manager for assistance.

This sidebar has two tabs:

  • Agents - lists all running agents and the dynamic logs you've attached to them from IntelliJ; this part of the sidebar is divided by Tags and Agents

    Agents and Tags -quarter

  • Exceptions - lists exceptions logged on running agents

Additionally, you can view dynamic logs in real time directly from the Lightrun Console, located as part of the bottom sidebar.

You can search for dynamic logs and snapshots from within specific agents with the dynamic search field. As you start typing, the list of agents updates dynamically.

Login Dialog -quarter

Tip

This can be particularly helpful in finding specific dynamic logs when working with multiple agents.

Agents and Tags list

The Tags list appears similar to the following:

The Tags list -half

The layout of the Agents list appears similar to the following:

The Agents List -half

Each list has a panel at the top that contains the following information:

  • An arrow to expand and collapse the list per tag or per agent.
  • The name of the agent or list
  • In parenthesis, the total number of actions assigned to that tag or agent
  • For Tags lists, the Status -icon icon
  • For Agents lists, the icons as described below

Most of the icons are relevant for both the Agents and the Tags lists:

Agent Details -half

The following table describes the actions you can leverage from both:

Icon Component Description
1 View details -icon Details Opens the information dialog box for the agent, the tag or for the action
2 View/hide dynamic logs -icon View/hide dynamic logs Toggle this button to hide/show dynamic logs in the editor. This applies to the hierarchy and can be toggled globally on the login button.
3 Pipe dynamic logs -icon Pipe dynamic logs From the Agents list only, by default Lightrun dynamic logs print into the same logger that is used by your application. Following are the three options: App Only (the default), Plugin Only and Both. When set to Plugin Only or Both dynamic logs added to this agent also appear in the Lightrun console of IntelliJ.
4 Delete -icon Delete action Delete any agent or tag actions. Only agent-activated actions can be deleted from the Agents list and tag-activated actions from the Tags list.
5 Go to line -icon Go to line Jump to the source file and line number in the code that is associated with the action.
6 Status -icon Toggle Toggle to disable or enable an action. Only agent-activated actions can be toggled from the Agents list and tag-activated actions from the Tags list.
7 Status -iconStatus -icon Status indicator Displays the current state of the action. One checks indicates the action was submitted to the server. Two checks indicate that it was received by the agent. Highlighted checks indicate that the agent accepted the action. From the Agents list, the tag icon indicates the action was activated with tags and not agents, and its status can be viewed from the Tags list.
8 Log level -icon Log level indicator Indicates the the level that was configured for the log (on log rows only): Info, Debug, Warn, Error.

Agent and Lightrun action details

To view details, click View details -icon from the relevant row.

The Details dialog window pops up.

For actions, the window appears similar to the following:

View action details -third

The following table describes the information displayed in this window:

Field Description
ID The system-generated ID associated with this action item.
Name The name assigned to the action when it was added.
Type The type of action.
Start Location The file and code line where the action starts following behavior.
End Location The file and code line where the action stops following behavior.
Create Time The time and day on which the action was created.
Owner The user who created the action.
Quota in effect The quota controls use of CPU, Networking, Memory, excessively long strings, too many instructions printing out, protection from infinite loops and the like.
Quota settings can be tuned in the agent.config file.
Log Message The message resulting from the action appears here, if relevant.
Error Message If any agent reports any errors for this action, they are documented here.

For agents, the Details appears similar to the following including details about location, versioning, associated tags and the piping mode:

View agent details -third

The information in the agent Details window is as described in the following table:

Field Description
Host The name of the machine where the agent is runnning.
ID The unique identification number automatically generated for the action.
PID The process ID (for the machine where the agent is running).
Start Time The time at which the agent started running.
API Version The version of the API used by the agent.
Agent Version The version of the agent.
Piping Mode The configured piping method.
Tags All tags that have been applied to this agent.

Viewing the output

The Console and Snapshot views enable you to view log, metric and snapshot data in real time directly from the IDE, depending on the kind of instrumentation you've added. The data available in these views includes all of the instrumention you've added and all of the instrumentation added by others on your team as well.

From the IDE, you can:

  • configure log piping to view data directly from the IDE
  • view dynamic logs and metrics
  • view the stacktrace based on the snapshots you added

Data output is sent to your IDE, the CLI, the web interface, or your integrated logging tools depending on how you've configured piping.

By default, all output is piped to the web interface in the web interface. To view data from the IDE, you must first configure the piping accordingly.

There are three levels of log piping:

  • App - the dynamic logs appear only in the Lightrun web interface, as they do by default.
  • Plugin - that dynamic logs won't appear in the web interface. Instead they appear in the Lightrun Console of your IDE, the CLI, or your integrated logging tools.
  • Both - that dynamic logs wll appear both in the web interface and in any integrations you're using.
To configure piping
  1. Navigate to the Lightrun right-hand sidebar:

    Sidebar -quarter

  2. From the relevant agent, click Sidebar -icon to open the Piping menu:

    Log Piping -ten

  3. Set the Plugin or the Both option to view dynamic logs from the IDE.

Note

In order to pipe the dynamic logs they need to go from the agent to the Management server and to the plugin. This process is batched so dynamic logs appear in batches and with some delay.

Note

Read more about how to view dynamic logs, metrics, set values and the stacktrace based on the instrumentation you added.


Last update: May 6, 2021