XRAY: Log rotation for JFrog Xray

Ujwal Poovaiah
2023-01-22 11:06

Subject :

How to Customize the log rotation for JFrog Xray in 2.x and 3.x versions.

Description :

For 3.x Xray versions

In Xray 3.x versions, the log rotation can be customized for each microservice in the system.yaml file located under /var/etc/ directory by adding the below parameters. Similarly, you can configure log rotation for other microservices as well, refer to theXray system.yamlfile for example snippets.

Example for one of the microservice.## XRAY PERSIST TEMPLATE
persist:
logging:
rotation:
#compress: true
#maxSizeMb: 25
#maxFiles: 10

For 2.x Xray versions

Log rotation can be customized based on your requirement (default log rotation is enabled on a daily basis) for each microservice logs in the /data/config/_log4go_config.xml file by modifying required properties.

Example :

Modifying the ‘rotate’, ‘daily’ and ‘maxbackup’ properties, etc … and log location can be changed by giving the different path in the property ‘filename’

Micro Services:

analysis_log4go_config.xml
indexer_log4go_config.xml
server_log4go_config.xml
persist_log4go_config.xml

Properties:

rotate The number of rotation logs to keep.
maxsize Maximum size of the file in megabytes.
maxlines Maximum line of the file in megabytes.

daily Rotate the log every day.

maxbackup Maximum number of backup
filename Modify the path of the log location
/var/opt/jfrog/xray/data/logs/xray_analysis.log
[%D %T] [%L] (%S) %M
true
10M
0K
true
10