Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass max-size and max-file to the docker driver #971

Merged
merged 1 commit into from
Sep 5, 2019

Conversation

cyriltovena
Copy link
Contributor

This allows docker driver users to control max-file and max-size of the json-log driver used by Loki driver.

I didn't remove the json-log as it allows users to keep using docker logs in combination of Loki driver.

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #966

Special notes for your reviewer:

Checklist

  • [ x] Documentation added
  • [ x] Tests updated

@@ -129,6 +132,8 @@ To specify additional logging driver options, you can use the --log-opt NAME=VAL
| `loki-tls-server-name` | No | | Name used to validate the server certificate.
| `loki-tls-insecure-skip-verify` | No | `false` | Allow to skip tls verification.
| `loki-proxy-url` | No | | Proxy URL use to connect to Loki.
| `max-size` | No | -1 | The maximum size of the log before it is rolled. A positive integer plus a modifier representing the unit of measure (k, m, or g). Defaults to -1 (unlimited). This is used by json-log required to keep the `docker log` command working.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we default to unlimited? I would think something like 100m might be a better default, since most people are not going to want unlimited file growth a default of unlimited would mean everyone needs to configure this flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default for docker driver. https://docs.docker.com/config/containers/logging/json-file/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I'm not against doing a better job.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to match the defaults of docker to remain consistent, although I don't feel strongly about this one way or the other

Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cyriltovena cyriltovena merged commit 5cd384a into grafana:master Sep 5, 2019
cyriltovena pushed a commit to cyriltovena/loki that referenced this pull request Jun 11, 2021
…ex-lookups""

This reverts commit 8b74f9053037c4590ec1512b65288e4869d5e748.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loki Docker driver uses an unbounded json log file
3 participants