homebridge / docker-homebridge

Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
https://hub.docker.com/r/homebridge/homebridge/
GNU General Public License v3.0
2.57k stars 240 forks source link

Log file grows indefinitely. #399

Closed jrrios closed 2 years ago

jrrios commented 2 years ago

The log file under /var/lib/docker/containers/<container_id>/<container_id>-json.log grows without stopping. It got to be as large as 88GB in my system and there's no obvious way to modify the logging behavior on the UI.

oznu commented 2 years ago

This is a docker configuration. See https://stackoverflow.com/a/52927765

If using compose, add this:

    logging:
      driver: "json-file"
      options:
        max-size: "10m"

eg.

version: '2'
services:
  homebridge:
    image: oznu/homebridge:ubuntu
    restart: always
    network_mode: host
    environment:
      - PGID=1000
      - PUID=1000
      - HOMEBRIDGE_CONFIG_UI=1
      - HOMEBRIDGE_CONFIG_UI_PORT=8581
      - TZ=Australia/Canberra
    volumes:
      - ./volumes/homebridge:/homebridge
    logging:
      driver: "json-file"
      options:
        max-size: "10m"

Remember to run docker-compose up -d after making any changes to the compose file.

If you're not using docker-compose, see the docs:

https://docs.docker.com/config/containers/logging/local/#usage