Change console logging level?

Hello All, hoping one of the excellent people here can help with an odd question. How does one change the log level of the messages to the docker console?

I’m running the containerized version of ESPHome and collecting the logs to a central location for all hosts and containers using Loki. Everything is working, however, I also have a Docker healthcheck setup and every time the healthcheck runs ( every minute) ESPHome outputs the text below. It’s totally unnecessary and would be nice to raise the logging level to warning or error and omit these.

2023-07-07 17:10:51,241 INFO 200 GET / (127.0.0.1) 0.33ms

Hi @mwolter! Did you find a way to change the log level? I have exactly the same question.

Unfortunately, I have not. I thought these logs are generated by nginx but could not find nginx installed. Ended up disabling docker healthcheck to reduce the unnecessary logging. Would like to enable healthcheck, if you find anything, please let me know.

@mwolter I’ve accidentally found a solution while looking for a way to set a password for the esphome instance: I’ve changed startup command in docker compose file to include -q command which makes it completely silent in docker logs:

...
  esphome:
    container_name: esphome
    image: ghcr.io/esphome/esphome
    volumes:
      - /path/to/esphome/config:/config
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "6052:6052"
      - "6123:6123"
    environment:
      - ESPHOME_DASHBOARD_USE_PING=true
    restart: always
    privileged: true
    network_mode: host
    command: -q dashboard --username user --password 123 /config
    healthcheck:
      test: ["CMD", "curl", "--fail", "http://127.0.0.1:6052"]
      interval: 10s
      timeout: 30s
      retries: 5

I hope it helps.

1 Like

I’m using ESPHome as an addon from home assistant so cannot change anything on the docker file. Is there any other option to set logging level forESPHome to Warning?