Skip to content

Dynamic logs

As your team works with Lightrun, they can dynamically insert logs to track information based on a variety of conditions.

Once a log is inserted into the application, it is printed with the help of the java.util.logging logger. By printing into the standard logging framework, you can view the dynamic logs in the context of pre-existing log statements, which might provide further clues towards solving issues.

At the same time, a developer might want to see the log output and search and filter directly from the IDE as they work, while other users might want to see the list of logs from the Management Portal in table format.

Users can control the piping of the output from the plugin.

Depending on configuration, all relevant information from any logs that are added to your applications appears in the developers' consoles, in the Management Portal, or in both. If piped only to the plugin, data will not appear in the Management Portal, and vice versa.

To view log data

Prerequisites

To view logs from the Management Portal, first ensure you've configured piping from the plugin. Only data that has been configured to pipe to the Management Portal or to the Management Portal and the IDE appear in the app, meaning that if developers add actions with plugin piping only, those data do not appear anywhere else.

  1. You can customize log prints by entering on your terminal the following command:

    -Djava.util.logging.config.file=/path/to/app.properties
    
  2. To view log data from the app, log in from the browser and navigate to Entities > Agents Logs.

    The logs screen loads, and appears similar to the figure, below.

    Logs in app

    Key to column headings in the Agents Logs table:

    Column Description
    AgentId The unique identifier assigned to the agent by the system
    Timestamp The time at which the log was created
    Level The severity level of the log; this is configured per log when inserted in the code
    Log The formatted text configured when the log is inserted and any relevant errors

Note

See here for more information about using dynamic logs.


Last update: January 18, 2022