17.2. Changing Data Grid Server logging configuration at runtime
Modify the logging configuration for Data Grid Server at runtime to temporarily adjust logging to troubleshoot issues and perform root cause analysis.
Modifying the logging configuration through the CLI is a runtime-only operation, which means that changes:
-
Are not saved to the
log4j2.xmlfile. Restarting server nodes or the entire cluster resets the logging configuration to the default properties in thelog4j2.xmlfile. - Apply only to the nodes in the cluster when you invoke the CLI. Nodes that join the cluster after you change the logging configuration use the default properties.
Procedure
- Create a CLI connection to Data Grid Server.
Use the
loggingto make the required adjustments.List all appenders defined on the server:
logging list-appendersThe command provides a JSON response such as the following:
{ "STDOUT" : { "name" : "STDOUT" }, "JSON-FILE" : { "name" : "JSON-FILE" }, "HR-ACCESS-FILE" : { "name" : "HR-ACCESS-FILE" }, "FILE" : { "name" : "FILE" }, "REST-ACCESS-FILE" : { "name" : "REST-ACCESS-FILE" } }List all logger configurations defined on the server:
logging list-loggersThe command provides a JSON response such as the following:
[ { "name" : "", "level" : "INFO", "appenders" : [ "STDOUT", "FILE" ] }, { "name" : "org.infinispan.HOTROD_ACCESS_LOG", "level" : "INFO", "appenders" : [ "HR-ACCESS-FILE" ] }, { "name" : "com.arjuna", "level" : "WARN", "appenders" : [ ] }, { "name" : "org.infinispan.REST_ACCESS_LOG", "level" : "INFO", "appenders" : [ "REST-ACCESS-FILE" ] } ]Add and modify logger configurations with the
setsubcommandFor example, the following command sets the logging level for the
org.infinispanpackage toDEBUG:logging set --level=DEBUG org.infinispanRemove existing logger configurations with the
removesubcommand.For example, the following command removes the
org.infinispanlogger configuration, which means the root configuration is used instead:logging remove org.infinispan
17.2.1. Access logging リンクのコピーリンクがクリップボードにコピーされました!
The command also allows for enabling access logs during runtime to analyze issues. You can enable the access logging for a specific endpoint and utilize the CLI command to parse those files to generate server-side metrics. This technique is useful in identifying whether latency is an issue from the connection between client and server or intra-cluster.
The workflow for this analysis involves a few steps:
Enable access logging with the CLI for the endpoint you are analyzing.
logging set --level=TRACE org.infinispan.RESP_ACCESS_LOGIn this example, enabling the access log for the RESP endpoint.
- Run the tests to reproduce the issue or workload to measure.
Disable access logging with the CLI.
logging set --level=INFO org.infinispan.RESP_ACCESS_LOGDownload the access log files.
The
server reportcommand is also capable of downloading the log files.
With the access log files available, you can utilize the CLI command to analyze the server’s behavior more deeply. The CLI command provides information about long-running commands, segmentation per client, and operations.
Categories
Data Grid provides an access log for each endpoint available on the server. You can edit the logging level to enable each endpoint individually. The loggers available for each endpoint are:
-
org.infinispan.HOTROD_ACCESS_LOG: Enables the access log for the Hot Rod endpoint. -
org.infinispan.REST_ACCESS_LOG: Enables the access log for the REST endpoint. -
org.infinispan.MEMCACHED_ACCESS_LOG: Enables the access log for the Memcached endpoint. -
org.infinispan.RESP_ACCESS_LOG: Enables the access log for the RESP endpoint.
Observe that each logger can be activated individually and independently of the others.