milvus-operator icon indicating copy to clipboard operation
milvus-operator copied to clipboard

Setting Milvus log level config is not working

Open YGao119 opened this issue 8 months ago • 5 comments

I am trying to set milvus log level to "warn"+ (since the proxy node is logging too much in production), but all the config for log level doesn't seem to be working. I wonder if there is other way to set the log level correctly or if I am missing something here.

Also, It will be great to know how to set log level for individual component and dependency.

Tried both below.

...
spec:
  mode: cluster

  config:
    log:
      level: warn
  ...
...
spec:
  mode: cluster

  config:
    milvus:
      log:
        level: warn
  ...

YGao119 avatar May 08 '25 17:05 YGao119

Hi @YGao119 , the first one is correct. But it doesn't support dynamic reload. So you need to rollout restart all your milvus deployments to make it work.

haorenfsa avatar May 09 '25 03:05 haorenfsa

Thank you for the quick response. I deploy milvus cluster in k8s, and I created a new cluster with the config directly with kubectl apply.

In the configmap, I can see the log setting

│ apiVersion: v1                                                                                                                                                      │
│ data:                                                                                                                                                               │
│   user.yaml: |                                                                                                                                                      │
│     dataCoord:                                                                                                                                                      │
│       enableActiveStandby: true                                                                                                                                     │
│     etcd:                                                                                                                                                           │
│       endpoints:                                                                                                                                                    │
│       - jason-test-etcd-0.jason-test-etcd-headless.milvus:2379                                                                                                      │
│       - jason-test-etcd-1.jason-test-etcd-headless.milvus:2379                                                                                                      │
│       rootPath: jason-test                                                                                                                                          │
│     indexCoord:                                                                                                                                                     │
│       enableActiveStandby: true                                                                                                                                     │
│     log:                                                                                                                                                            │
│       level: warn 

and I can still see these logs in all the nodes (querynode, proxy, ...)

│ proxy [2025/05/09 18:14:00.413 +00:00] [DEBUG] [metrics/thread.go:53] ["thread watcher observe thread num"] [threadNum=23]                                          │
│ proxy [2025/05/09 18:14:30.413 +00:00] [DEBUG] [metrics/thread.go:53] ["thread watcher observe thread num"] [threadNum=23]                                          │
│ proxy [2025/05/09 18:15:00.413 +00:00] [DEBUG] [metrics/thread.go:53] ["thread watcher observe thread num"] [threadNum=23]                                          │
│ proxy [2025/05/09 18:15:30.413 +00:00] [DEBUG] [metrics/thread.go:53] ["thread watcher observe thread num"] [threadNum=23]                                          │                                                                                                                           

I am wondering if I miss anything here.

YGao119 avatar May 09 '25 18:05 YGao119

@YGao119 Your configuration is correctly set. Some code are executed before milvus changes its log level, that's why you may see some output logs of lower level. I'm quite sure it works. If you still worries about it, you can check the actual configs loaded through milvus web UI : https://milvus.io/docs/milvus-webui.md

haorenfsa avatar May 12 '25 06:05 haorenfsa

@haorenfsa It does apply to the configurations as you said. But it seems like this code does not follow the config for some reason and keeps logging

[DEBUG] [metrics/thread.go:53] ["thread watcher observe thread num"] [threadNum=17] 

YGao119 avatar May 12 '25 16:05 YGao119

@YGao119 Yes, that's an issue of milvus. Thank you for your feedback! 👍

haorenfsa avatar May 13 '25 02:05 haorenfsa