Closed AlexBatt closed 3 years ago
You can set the logger level to WARN
or ERROR
logger.set_level("WARN")
the logger setting would reduce only the logs of the eureka client, the issue is that the python eureka client updating it's status with eureka server, which, in turn, leads to very large log files on the eureka server. the client updates every minute it's status on the server, logs from eureka server:
2020-11-03 09:07:10.068 INFO 14 --- [nio-9090-exec-7] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.8:af-python-service:9090 - UP 2020-11-03 09:07:10.576 INFO 14 --- [nio-9090-exec-1] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.8:af-python-service:9090 - UP 2020-11-03 09:07:40.103 INFO 14 --- [io-9090-exec-10] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.8:af-python-service:9090 - UP 2020-11-03 09:07:40.611 INFO 14 --- [nio-9090-exec-4] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.8:af-python-service:9090 - UP 2020-11-03 09:08:09.001 INFO 14 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms 2020-11-03 09:08:10.130 INFO 14 --- [nio-9090-exec-2] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.8:af-python-service:9090 - UP 2020-11-03 09:08:10.639 INFO 14 --- [nio-9090-exec-6] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.8:af-python-service:9090 - UP 2020-11-03 09:08:40.151 INFO 14 --- [nio-9090-exec-1] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.8:af-python-service:9090 - UP 2020-11-03 09:08:40.659 INFO 14 --- [io-9090-exec-10] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.8:af-python-service:9090 - UP 2020-11-03 09:09:09.001 INFO 14 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
A heartbeat is required to make sure that your instance is alive, the default heartbeat time setting is 30 seconds. You can set that interval time longer, the following code is set the heartbeat to 5 minutes. I think the best solution is to set the log level in your Eureka server to WARN, rather than setting this heartbeat interval too long.
eureka_client.init(eureka_server="http://your-eureka-server-peer1,http://your-eureka-server-peer2",
app_name="your_app_name",
renewal_interval_in_secs=300,
instance_port=your_rest_server_port)
thanks for your help, I'll take the necessary steps on my side
Hi,
I seems that python micro-service using eureka updates it's status in eureka very frequently. the eureka microservice logs are getting larger, consuming space.
from eureka logs: 2020-11-01 15:53:34.708 INFO 13 --- [Eureka-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms 2020-11-01 15:53:38.852 INFO 13 --- [http-nio-9090-exec-4] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:53:39.358 INFO 13 --- [http-nio-9090-exec-8] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:53:57.650 INFO 13 --- [http-nio-9090-exec-9] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:53:57.813 INFO 13 --- [http-nio-9090-exec-3] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:54:08.883 INFO 13 --- [http-nio-9090-exec-6] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:54:09.390 INFO 13 --- [http-nio-9090-exec-4] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:54:27.682 INFO 13 --- [http-nio-9090-exec-5] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:54:27.815 INFO 13 --- [http-nio-9090-exec-9] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:54:34.708 INFO 13 --- [Eureka-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms 2020-11-01 15:54:38.892 INFO 13 --- [http-nio-9090-exec-3] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:54:39.399 INFO 13 --- [http-nio-9090-exec-10] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:54:57.704 INFO 13 --- [http-nio-9090-exec-7] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:54:57.818 INFO 13 --- [http-nio-9090-exec-2] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:55:08.925 INFO 13 --- [http-nio-9090-exec-5] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:55:09.433 INFO 13 --- [http-nio-9090-exec-9] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:55:27.734 INFO 13 --- [http-nio-9090-exec-4] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:55:27.820 INFO 13 --- [http-nio-9090-exec-8] c.n.eureka.resources.InstanceResource : Status updated: AF-PYTHON-SERVICE - 172.18.0.7:af-python-service:9090 - UP 2020-11-01 15:55:34.708 INFO 13 --- [Eureka-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
my configuration: def init(self, eureka_server_url, app_name, server_port):
logger.set_level("DEBUG")
EurekaClient("http://eureka:9090/eureka/", "AF-PYTHON-SERVICE", 9090)
thanks, Alex