Configuring Logging

Sometimes it’s necessary to get detailed information about the running application or get additional data for problem analysis. This chapter describes how logging can be configured to get this information.

IMPORTANT: If you enable DEBUG level on the top packages a lot of debug information will be produced and such detailed logging can slow down the application significantly. The TRACE log level produces even more information. Use this configuration only when needed and always try to set more specific packages (to be logged). Do not use detailed debug logging in production environment for a long time and dispose of produced log information appropriately (log data might contain sensitive information).

Logging in DirX Audit Manager Classic

The DirX Audit Manager Classic application uses the Log4j 2 logging library for Java.
The configuration file location is:

install_path/web/audit-manager-classic.war/WEB-INF/classes/log4j2.properties

This file is in the Java properties format (key=value).

Log4J has three main components: loggers, appenders and layouts.

To generate DEBUG messages into the default log file (tomcat_install_path/logs/dirxaudit-manager.log) for the DirX Audit Manager Classic application, uncomment the following loggers:

logger.solutions-dirx-audit.name = solutions.dirx.audit
logger.solutions-dirx-audit.level = DEBUG

If you need more fine-grained logging, you can adjust the packages in the loggers (to a more specific package) or change the log level (for example, to TRACE). The set of possible levels contains: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL and OFF.

Changes after saving the configuration file are applied automatically after a defined time period expires. This time period is defined by the configuration key and value:

monitorInterval = 30

The value is defined in seconds and is set to 30 seconds as the default.

For more information on Log4j 2, visit http://logging.apache.org/log4j/2.x/.

Logging in DirX Audit Manager (REST)

The DirX Audit Manager application uses the Ngx-logger logging Angular library.
The configuration file location is:

install_path/web/audit-manager-tenantID/plugins/dirx-dxt-app-manager/assets/config/app-config.json

This file is in the JSON format. You can define log level by attribute common.logLevel. The level is an integer value that defines the log level for the application. The log level is used to filter the messages that are logged by the application. The lower the number, the more detailed the logging will be. The higher the number, the less detailed the logging will be. The set of possible levels contains: 0 – ALL, 1 – TRACE, 2 – DEBUG, 3 – INFO, 4 – WARN, 5 – ERROR, 6 – FATAL and 7 – OFF. The default value is 4 – WARN. There is an example of the configuration file with the DEBUG log level:

{
  …
  "common": {
    "logLevel": 2
  }
  …
}

The application is logging in the browser console, so you can see the log messages in the browser developer tools console tab.

Logging in DirX Audit Server

DirX Audit Server uses Log4j 2 (running in the Spring Boot container) for logging.
The configuration file location is:

install_path/server_container/tenants/tenantID/conf/log4j2.properties

This file contains configuration in common Log4j 2 properties format.

To generate DEBUG messages for the DirX Audit Server application into the default log file, uncomment or set (create/update) the following loggers:

logger.solutions-dirx-audit.name = solutions.dirx.audit
logger.solutions-dirx-audit.level = DEBUG

If you need more fine-grained logging, you can adjust the packages in the loggers (to a more specific package) or change the log level (for example, to TRACE).

DirX Audit Server stores logging messages in the default files:

  • install_path/server_container/tenants/tenantID/logs/dirxaudit-server.log

  • install_path/server_container/tenants/tenantID/logs/dirxaudit-server-errors.log. This file only stores error log messages and thus serves as a backup of error messages, which can be lost in the default file as the result of logging rollover.

Changes after saving the configuration file are applied automatically after a time period defined by the configuration key and value expires. For example:

monitorInterval = 10

The value is defined in seconds and is set to 10 seconds as the default.

Logging in DirX Audit Message Broker

DirX Audit Message Broker uses Log4j 2 (running in Apache ActiveMQ container) for logging.
The configuration file location is:

install_path/message_broker/conf/log4j2.properties

This file contains configuration in common Log4j 2 properties format.

If you need more fine-grained logging saved into the default log file
(install_path/message_broker/data/activemq.log), you can adjust the log level
(for example, to TRACE).

Changes after saving the configuration file are not applied automatically: you must restart the DirX Audit Message Broker service to apply the changes.

Logging in Tools

DirX Audit command-line tools use Java util logging API (integrated in JVM) for logging.

To enable debug logging in command-line tools (located in install_path/tools/) add a parameter -debug to the command.

Examples:

install_path/tools/db_fact_population/bin/dxtPopulateFacts -debug

install_path/tools/db_maintenance/bin/dxtdbtool export -dstdir outdir -debug

See the chapter “Using the DirX Audit Tools” in the DirX Audit Command Line Interface Guide for detailed tool usage.

The generated log file (the name contains the selected action and timestamp) is located in install_path/tools/tool_name/log/.

If you need more detailed or more fine-grained logging, you can directly modify the logging configuration file install_path/tools/tool_name/app/logging.properties.

To generate logging messages for the specific DirX Audit tool, uncomment or set the respective loggers with the required log level in this file.

This file is a simplified configuration file (in Java properties format), for details see the Java util logging documentation.