Skip to content

Configuring the CodeLogic Java Agent

Your CodeLogic agent needs to be configured in order to scan your unique environment.

  1. From a web browser on your system, log in to the CodeLogic Server.

  2. Click Admin and then select the Agents tab.

  3. Click the more menu icon in the Actions column and select View/Edit/Delete. The Edit window opens.
  4. Edit the configuration file.

    • Agent ID - The Agent ID is a unique identifier assigned by CodeLogic and is not configurable.
    • Agent Type - The Agent Type is the type of agent you have installed and is not configurable.
    • Agent Name - The Agent Name is the name you entered during installation. If you did not enter a descriptive name, the default name is used. To rename the agent, replace the text and click Save.
    • Agent Description - The Agent Description is a text field where you can enter a description for the agent.
    • Schedule - The schedule for scanning is configurable using a cron‑style entry. The default schedule is every four hours, every day, starting at 00:00.

    The scan is scheduled using a cron-like definition based upon the CronTrigger class. It is similar to entries specified in man -S 5 crontab but the fields and allowed characters differ slightly to allow for more powerful scheduling.

    Field Name Allowed Values Allowed Special Characters
    Seconds 0-59 , - * /
    Minutes 0-59 , - * /
    Hours 0-23 , - * /
    Day of Month 1-31 , - * ? / L W
    Month 1-12 or JAN-DEC , - * /
    Day of Week 1-7 or SUN-SAT , - * ? / L W

    Special characters:

    • *- (“all values”)
    • ?- (“no specific value”) – for example, when the scan should take place on the 10th day of the month any day of the week is acceptable
    • -- used to specify ranges – for example, 1-3 in the day of the month field means the 1st, 2nd, and 3rd day of the month
    • ,- used to specify additional values – for example, “TUES, THUR” in the Day of Week field means Tuesday and Thursday
    • /- used to specify the starting value and an increment – for example, 0/10 in the Minutes field means “the minutes 0, 10, 20, 30, 40, and 50”
    • L- (“last”) – the meaning of this character changes depending upon which field it is in, for example, “L” in the Day of Week field means Saturday but it can be combined for a specification like 5L, which means the last Thursday of the month
    • W- (“weekday”) - the weekday nearest specified day, for example, 20W is the weekday closest to the 20th day of the month
    • #- used to specify “the nth” NNN day of the month, for example, “5#1” = the first Thursday of the month and “4#3” = the third Wednesday of the month

    Scheduling examples

    • Scan every half hour starting at the top of the hour, every weekday

      0 0/30 \* \* \* MON-FRI

    • Scan every half hour, between the hours of 9 AM and 5 PM (0900 and 1700), every weekday

      0 0/30 9-17 ? \* MON-FRI

    • Scan at 9:40 PM (2140) every day

      0 40 21 ? \* \*

    • Batch Size - The Batch Size is the combined number of nodes and relationships to reach before sending information to the CodeLogic Server.

    • Agent Configurations - The Agent Configurations section provides a way to perform deeper analysis on the JARs found in the initial scan.

      • A list of applications - Click + to add applications to be scanned.
      • A list of databases - Click + to add the database connection(s) to be scanned. If the field is left empty, all databases will be scanned.
      • A list of recursions - Recursion applies to "fat jars" and classpath dependencies that the agent is able to reach.

      For example, if cc‑java‑agent‑main.jar has a dependency of codelogic‑base‑plugin.jar and it is in the CLASSPATH, codelogic‑base‑plugin.jar will also be decomposed even though it is not specified in the scanner section.

      • Enable method invocation Scanning - When checked, relationships are created when a method calls another method.
      • A list of methods to invoke scanning on - This restricts the scope of where the relationships are created.
      • ClassUsageRelationshipsEnabled - Attempt to create relationships for class usage on fields and methods.
      • Depth to scan - This value sets the number of sub-directories to be scanned. A value of 1 limits scans to the directories specified in List of paths to scan. A value of 4 will scan the files in the specified directory and the three directories below.
      • List of paths to scan - Click + to add the paths you would like to scan. You can click + to add more paths.
      • List of filter patterns - Click + to add specific applications to analyze. A simple match pattern is used.
  5. Optionally, click + to enter an additional Agent Configuration.

  6. Click Save to save your changes and close the Edit window.
  7. Logging

    • Logging is configured in the /opt/codelogic/java/application.yml file.

    • Standard syslog keywords are used to specify the agent logging level. For details on the keywords, please see the man pages for syslog or rsyslog, depending upon which is installed on your system.

    • Commands

    $ man -S 5 syslog.conf  
    $ man -S 5 rsyslog.conf

    # Modify the amount of logging output by specifying a package name and then pass a given log level.  
    logging:  
    level:  
    root: info  
    com.codelogic: info
Additional logging can be captured by replacing info with debug.