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

[QUESTION]: Where to set the log level?

Open icarosadero opened this issue 1 year ago • 1 comments

Is your question answered elsewhere?

What is your question?

On the docs, there's a page explaining various settings related to logging. However, there's no instruction about where or how to set those variables. Is log.level an environment variable? Do I set this on a file? It isn't clear.

Anything else?

No response

icarosadero avatar Aug 26 '23 18:08 icarosadero

The target configuration file (that contains log level settings) is inside milvus container, at /milvus/configs/milvus.yaml. You can either

  1. Go inside the container and modify the milvus.yaml, or
  2. Write another milvus.yaml outside the container, and modify docker-compose.yml to mount and map that file.

Assuming you are using milvus-standalone,

  • For option 1, you may
    1. Go inside the container
      docker exec -it docker-standalone bash
      
    2. Install a text editor
      apt update
      apt install nano
      
    3. Edit the file
      nano /milvus/configs/milvus.yaml
      
  • For option 2, you may
    1. Write a milvus.yaml with log settings:
      # Configures the system log output.
      log:
        level: warn # Only supports debug, info, warn, error, panic, or fatal. Default 'info'.
        file:
          rootPath: # root dir path to put logs, default "" means no log file will print. please adjust in embedded Milvus: /tmp/milvus/logs
          maxSize: 300 # MB
          maxAge: 10 # Maximum time for log retention in day.
          maxBackups: 20
        format: text # text or json
        stdout: true # Stdout enable or not
      
    2. Open docker-compose.yml and locate standalone.volumes
    3. Modify docker-compose.yml:
      standalone:
        ...
        volumes:
          ...
          <full path of milvus.yaml>:/milvus/configs/milvus.yaml
        ...
      

In addition, you can also change log level during runtime:

curl -X PUT localhost:9091/log/level -d "level=warn" # assuming server is localhost and target level is warn

BrandonStudio avatar Dec 25 '23 07:12 BrandonStudio