How to Disable com. netflix. servo. submit. jmxmetricpoller Using log4j2. yml

how to switch off com.netflix.servo.publish.jmxmetricpoller through log4j2.yml
how to switch off com.netflix.servo.publish.jmxmetricpoller through log4j2.yml

How to Disable com. netflix. domestico. publish. jmxmetricpoller through log4j2. yml

Introduction

The com. netflix. servo. publish. jmxmetricpoller is a JMX metric poller that is definitely used by the particular Netflix Servo supervising library to acquire metrics from some sort of Java application. In some cases, you may want to disable this poller, for example, in the event that you are applying a different checking solution or in the event that you are experiencing performance issues.

Disabling the particular poller using log4j2. yml

One way to disable the com. netflix. servo. publish. jmxmetricpoller is definitely to use the particular log4j2 logging construction. Log4j2 allows anyone to configure the particular logging level for individual classes or perhaps packages, and a person can use this kind of to disable the logging for the com. netflix. servo. submit. jmxmetricpoller class.

To do this, add the following configuration to your log4j2. yml record:

 logging: level: contendo. netflix. servo. post. jmxmetricpoller: OFF 

This specific will disable just about all logging for typically the apresentando. netflix. servo. submit. jmxmetricpoller class, including the logging that is used to start the poller. While a result, the particular poller will certainly not be started and even will not accumulate any metrics.

Disabling the particular poller using some sort of system property

Another way to disable typically the com. netflix. servo. submit. jmxmetricpoller is to fixed the servo. jmx. empowered method property to false . This will prevent the poller from being started, also if logging is definitely enabled for typically the contendo. netflix. servo. publish. jmxmetricpoller class.

To set the system property, an individual can use the particular following command:

 java -Dservo. jmx. enabled=false... 

You can also set the method property in your code, using typically the following code:

 Program. setProperty("servo. jmx. enabled", "false"); 

Conclusion

Disabling typically the com. netflix. servo. submit. jmxmetricpoller can be beneficial in certain scenarios, such as if you are making use of a different supervising solution or if you are suffering from performance issues. Anyone can disable the particular poller using log4j2. yml or simply by setting the servo. jmx. enabled system property.