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

Add no-file and keep-file log option for docker driver. #1906

Merged
merged 2 commits into from
Apr 13, 2020

Conversation

cyriltovena
Copy link
Contributor

@cyriltovena cyriltovena commented Apr 7, 2020

By default no-file is false, this means the driver will create json log files that can be used to run docker logs command.
If no-file is true, no files are created and so docker log won't work. This allow the ability to run the driver without caring of space left on the host.

keep-file tells the driver to keep file even after the container has been stopped, by default this options is false. This means files are cleaned up once containers are stopped and not history is left to be used for docker logs.

Fixes #1868
Fixes #1886

Signed-off-by: Cyril Tovena cyril.tovena@gmail.com

By default no-file is false, this means the driver will create json log files that can be used to run `docker logs` command.
If no-file is true, no files are created and so `docker log` won't work. This allow the ability to run the driver without caring of space left on the host.

keep-file tells the driver to keep file even after the container has been stopped, by default this options is false. This means files are cleaned up once containers are stopped and not history is left to be used for `docker logs`.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #1906 into master will increase coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1906      +/-   ##
==========================================
+ Coverage   64.57%   64.65%   +0.07%     
==========================================
  Files         125      125              
  Lines        9477     9477              
==========================================
+ Hits         6120     6127       +7     
+ Misses       2929     2925       -4     
+ Partials      428      425       -3     
Impacted Files Coverage Δ
pkg/promtail/targets/filetarget.go 70.55% <0.00%> (+1.84%) ⬆️
pkg/promtail/targets/tailer.go 78.40% <0.00%> (+4.54%) ⬆️

@cyriltovena cyriltovena changed the title Add no-file and keep-file option. Add no-file and keep-file log option for docker driver. Apr 7, 2020
cmd/docker-driver/driver.go Outdated Show resolved Hide resolved
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@cyriltovena
Copy link
Contributor Author

@ushuz Appreciate the review, I've fixed those comment, PTAL ! ✌️

Copy link
Contributor

@ushuz ushuz left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

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

lgtm

@owen-d owen-d merged commit 25aed2b into grafana:master Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker plugin: Cleanup stale JSON log files loki plugin grows without end
4 participants