ARTIFACTORY: How To Add Debug Loggers in Artifactory
Since Artifactory application is a combination of Java and Go based modules, currently there are two methods to enhance log verbosity in Artifactory based on the microservice type:
- By incorporating debug loggers in the logback.xml file for Access, Artifactory and Mission Control microservices
- By modifying the log level in the system.yaml file for microservices like metadata, frontend, router etc
How to add the debug loggers in logback.xml file
The logback.xml file serves as the configuration file that defines the logging behavior for the Access, Artifactory services. By incorporating additional loggers in the logback.xml file, log verbosity can be enabled.
The logback.xml file can be found at the following locations based on the specific microservice:
Artifactory:
$JFROG_HOME/artifactory/var/etc/artifactory/logback.xml
Access:
$JFROG_HOME/artifactory/var/etc/access/logback.xml
Mission Control:
$JFROG_HOME/artifactory/var/etc/mc/logback.xml
These paths can be referenced to locate the respective logback.xml files for Artifactory, Access, and Mission Control microservices.
In certain situations, it may be necessary to update the logback.xml file to enable debug mode. To include the loggers provided by JFrog in the logback.xml file, please follow the steps below:
- Navigate to the bottom of the logback.xml file until you reach the closing tag </configuration>.
- Prior to the closing </configuration> tag, insert the debug loggers.
Example:
How to Change the log level for Go based microservices in system.yaml file
The system.yaml file can be found in the directory $JFROG_HOME/artifactory/var/etc/.
To enable verbose logging, it is possible to modify the log level for specific microservices within the system.yaml file. Below is an example snippet demonstrating how to enable the debug log level for the Frontend and Router microservices:
Example:
frontend:
logging:
application:
level: debug
router:
logging:
application:
level: debug
Please note the following:
- No restart is required after adding loggers to the logback.xml file.
- It is important to exercise caution when enabling debug loggers, as they can generate a significant volume of log output that may impact system performance. It is generally recommended to enable debug loggers only when actively troubleshooting or investigating specific issues.
- Once the necessary information has been collected, it is advisable to remove the debug loggers from the logback.xml file or revert the log level back to its default setting in the system.yaml file to avoid unnecessary overhead.
- For additional information, you can refer to the following resource: Grocery: link to JFrog Platform Administration Documentation - Logging.