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 Details window for additional action and agent details
The plugin layout¶
!!! reqs "Prerequisites" To use the plugin, make sure:
- You've attached at least one agent to your app. - You install the plugin in your local IntelliJ instance). - You [authenticate IntelliJ](authenticate-plugin.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:
This sidebar displays all the running agents and their tags, as well as the actions that have been attached to them.
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
- 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.
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 layout of the Agents list appears similar to the following:
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 icon
- For Agents lists, the icons as described below
Most of the icons are relevant for both the Agents and the Tags lists:
The following table describes the actions you can leverage from both:
|1||Details||Opens the information dialog box for the agent, the tag or for the action|
|2||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||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: |
|4||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||Jump to the source file and line number in the code that is associated with the action.|
|6||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 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 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 from the relevant row.
The Details dialog window pops up.
For actions, the window appears similar to the following:
The following table describes the information displayed in this window:
|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:
The information in the agent Details window is as described in the following table:
|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 Lightrun Management Portal, or your integrated logging tools, depending on how you've configured piping.
By default, all output is piped to the Lightrun Management Portal. To view data from the IDE, you must configure the piping accordingly.
There are three levels of log piping:
- App - the dynamic logs appear only in the Lightrun Management Portal, as they do by default.
- Plugin - that dynamic logs won't appear in the Management Portal. Instead they appear in the Lightrun Console of your IDE, the CLI, or your integrated logging tools.
- Both - that dynamic logs will appear both in the Management Portal and in any integrations you're using.
To configure piping:
In the Lightrun plugin, navigate to the right-hand sidebar:
From the relevant agent, click to open the Piping menu:
To view dynamic logs from the IDE, set either the Plugin or the Both option.
Dynamic logs are sent from the agent to the plugin via the Lightrun management server. As this process is batched, dynamic logs may appear with a slight delay.