How to collect error log files in Junos Space

  [KB17407] Show Article Properties


Summary:

This article provides information on how to collect error log files in Junos Space for troubleshooting purposes.

Solution:

Collecting Junos Space Error Logs

You can collect Junos Space error logs using the Web UI or CLI.


Note: Capture existing Junos Space troubleshooting logs prior to enabling the DEBUG logging level. That way you will not inadvertently purge data that might be needed for JTAC analysis.

To change the default logging level from WARN to DEBUG, see "Changing the Logging Level," below.

Changing the Logging Level

Web UI

From Junos Space versions 16.1 and above, you can change the logging level for the logs from the WebUI.

  1. Follow the path:  Network Application Platform > Administration > Space Troubleshooting > Log Configuration
  2. Select the file for which you wish to change the logging level and choose the Log Level from the drop-down:
  3. Click on Save and Update. No service needs to be restarted after this change.

CLI

For Junos Space versions 13.1 and below:

The logging level can be changed by editing the /usr/local/jboss/server/all/conf/jboss-log4j.xml file.  In this file, change the logging level from WARN to DEBUG for the section below:

Note: Searching for 'root' (case sensitive) is the fastest way to find the area to edit.

<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->

<!--ROOT Logger-->
<category name="org.apache.solr">
<priority value="WARN"/> <<<<< Do not change this value.
</category>
<root>
<priority value="WARN"/> <<<<< Change only this value.

For Junos Space versions 13.2 and above:

Logging parameters are managed via the JBoss Web application server CLI. Note: Pay attention to text wraparound. Each line contains only one command.

 
  1. Run:
    /usr/local/jboss/bin/jboss-cli.sh --connect --controller=jmp-CLUSTER:9999
    OR
    /usr/local/jboss/bin/jboss-cli.sh --connect --user=admin --password=juniper_123 --controller=jmp-CLUSTER
  2. Enter:  connect
  3. Enter:  /profile=full-ha/subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="WARN")
  4. Enter:  /profile=full-ha/subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="level", value="WARN")
  5. (OPTIONAL) To modify SD logging (SD 13.3 and later):
    /profile=full-ha/subsystem=logging/logger=net.juniper.space.sm:change-log-level(level=WARN)

    /profile=full-ha/subsystem=logging/logger=net.juniper.space.sd:change-log-level(level=WARN)

    /profile=full-ha/subsystem=logging/logger=net.juniper.sm:change-log-level(level=WARN)

    /profile=full-ha/subsystem=logging/logger=net.juniper.jnap.sm:change-log-level(level=WARN)

    /profile=full-ha/subsystem=logging/size-rotating-file-handler=FILE:change-log-level(level=WARN)

    /profile=full-ha/subsystem=logging/size-rotating-file-handler=SD_LOG:change-log-level(level=WARN)
  6. (OPTIONAL) To modify Network Director logging and enable monitor.log and collector.log (ND 13.3 and later):
    cd /profile=full-ha/subsystem=logging

    ./size-rotating-file-handler=NetworkDirector:change-log-level(level=DEBUG)

    ./logger=net.juniper.jmp.cm:write-attribute(name=level, value=DEBUG)


    ./size-rotating-file-handler=Monitoring:add(level=DEBUG, file={"relative-to"=>"jboss.server.log.dir", "path"=>"monitoring.log"}, append=true, autoflush=true, max-backup-index=15)

    ./size-rotating-file-handler=NDCollectorLog:add(level=DEBUG, file={"relative-to"=>"jboss.server.log.dir", "path"=>"collector.log"}, append=true, autoflush=true, max-backup-index=15)
    Note: For steps 3, 4 and 5, enter FATAL, ERROR, WARN, INFO, or DEBUG, depending on the logging verbosity needed (shown from lowest to highest, above). WARN is the default. DEBUG is used for JTAC debugging.

  7. Sometimes it is necessary to increase the number of files and/or file sizes during DEBUG collection to increase the time span contained in the logs. To increase the number of files and/or file sizes during DEBUG collection, perform the following:
    1. Enter: /profile=full-ha/subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="rotate-size", value="50m")
    2. Enter: /profile=full-ha/subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="max-backup-index", value="10")

  8. To exit the JBoss CLI, enter: quit

Notes:

  • Increase the 50m and 10, accordingly.
  • FILE corresponds to server.log. Other valid options include HORNETQ, SERVICENOW_LOG, SERVICEINSIGHT_LOG, SERVICENOW_OSSJ_LOG, and SD_LOG. These options correspond to hornetQ.log, serviceNow.log, serviceInsight.log, serviceNow_OSSJ.log, and SD.log, respectively.
  • The rotate-size default value is 50m for all the logs above.
  • The max-backup-index default values are 10 for server.log and hornetQ.log, and 15 for the others.

   Note: You do not have to restart JBoss if you are only changing the logging level (for example, WARN to DEBUG). This change takes effect dynamically. However, you MUST restart the JBoss service if you change the rotate-size or max-backup-index values (e.g., #service jboss restart).

Related Links: