20

I configured my application in docker compose to use rotating logs, following the in the following site: https://medium.com/@Quigley_Ja/rotating-docker-logs-keeping-your-overlay-folder-small-40cfa2155412

my-app:
image: my-app:latest
logging:
    driver: "json-file"
    options:
        max-file: 5
        max-size: 10m

But when I run the program now it cannot start with the following error: b'json: cannot unmarshal number into Go struct field LogConfig.Config of type string'

Tudor
  • 2,224
  • 2
  • 21
  • 24

2 Answers2

48

Turns out I had to put " " around the values:

my-app:
image: my-app:latest
logging:
    driver: "json-file"
    options:
        max-file: "5"
        max-size: "10m"
Tudor
  • 2,224
  • 2
  • 21
  • 24
2

If anyone has this problem, just update composer to latest version. How to upgrade docker-compose to latest version

Capiloky
  • 21
  • 2
  • Was wondering why I started getting this error.. Turned out I've been always using "docker compose" and mistyped as "docker-compose". – TechGeorgii Aug 31 '23 at 09:52