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
The DirX Audit Manager Web application uses the Log4j 2 logging library for Java. The configuration file location is:
install_path/web/audit-manager-web-version.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 application, uncomment the following loggers:
logger.com-dirxcloud-audit.name = com.dirxcloud.audit logger.com-dirxcloud-audit.level = DEBUG logger.net-atos-dirx-audit.name = net.atos.dirx.audit logger.net-atos-dirx-audit.level = DEBUG logger.com-siemens-dxt.name = com.siemens.dxt logger.com-siemens-dxt.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 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.com-dirxcloud-audit.name = com.dirxcloud.audit logger.com-dirxcloud-audit.level = DEBUG logger.net-atos-dirx-audit.name = net.atos.dirx.audit logger.net-atos-dirx-audit.level = DEBUG logger.com-siemens-dxt.name = com.siemens.dxt logger.com-siemens-dxt.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 User 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.