How to Disable possuindo. 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. servo. publish. jmxmetricpoller through log4j2. yml

Introduction

The com. netflix. servo. publish. jmxmetricpoller is definitely a JMX metric poller that will be used by this Netflix Servo supervising library to accumulate metrics from some sort of Java application. Throughout some cases, an individual may want to disable this poller, for example, if you are making use of a different supervising solution or if you are going through performance issues.

Disabling typically the poller using log4j2. yml

One way to disable the com. netflix. servo. publish. jmxmetricpoller is definitely to use typically the log4j2 logging construction. Log4j2 allows an individual to configure typically the logging level intended for individual classes or maybe packages, and an individual can use this kind of to disable this logging for the apresentando. netflix. servo. publish. jmxmetricpoller class.

To do this particular, add the following configuration to the log4j2. yml file:

 logging: level: apresentando. netflix. servo. distribute. jmxmetricpoller: OFF 

This kind of will disable most logging for the com. netflix. servo. submit. jmxmetricpoller class, including typically the logging that is usually used to begin the poller. As a result, typically the poller will not necessarily be started and even will not accumulate any metrics.

Disabling typically the poller using the system property

Another method to disable this apresentando. netflix. servo. post. jmxmetricpoller is to fixed the servo. jmx. enabled method property to false . This will prevent the poller coming from being started, actually if logging will be enabled for typically the contendo. netflix. servo. submit. jmxmetricpoller class.

To set typically the system property, you can use typically the following command:

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

You can also set the system property in your own code, using the following code:

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

Conclusion

Disabling typically the possuindo. netflix. servo. publish. jmxmetricpoller can be beneficial in certain situations, such as if you are making use of a different supervising solution or in the event that you are suffering from performance issues. Anyone can disable typically the poller using log4j2. yml or by means of setting the servo. jmx. enabled system property.