moby--moby/daemon/logger
= b102d4637c Fix windows log file rotation with readers
This fixes the case where log rotation fails on Windows while there are
clients reading container logs.

Evicts readers if there is an error during rotation and try rotation again.
This is needed for Windows with this scenario:

1. `docker logs -f` is called
2. Log rotation occurs (log.txt -> log.txt.1, truncate and re-open
   log.txt)
3. Log rotation occurs again (rm log.txt.1, log.txt -> log.txt.1)

On step 3, before this change, the log rotation will fail with `Access
is denied`.
In this case, what we have is a reader holding a file handle to the
primary log file. The log file is then rotated, but the reader still has
a the handle open. `FILE_SHARE_DELETE` allows this to happen... but then
we try to do it again for the next rotation and it blows up.
So when it blows up we force all the readers to disconnect, close the
log file, and try rotation again, which will succeed based on the added
tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-10-29 18:38:30 +00:00
..
awslogs bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
etwlogs Add canonical import comment 2018-02-05 16:51:57 -05:00
fluentd Fluentd: add fluentd-request-ack option 2020-02-11 02:13:24 +01:00
gcplogs Fix gcplogs memory/connection leak 2020-09-30 17:45:19 -07:00
gelf logger/gelf: Skip empty lines to comply with spec 2019-11-25 11:55:15 +01:00
journald add partial metadata to journald logs 2020-09-01 12:54:05 +02:00
jsonfilelog Reduce allocations for logfile reader 2020-04-08 12:24:31 -07:00
local Reduce allocations for logfile reader 2020-04-08 12:24:31 -07:00
logentries Use a regex to match labels 2019-01-16 22:17:16 +00:00
loggerutils Fix windows log file rotation with readers 2020-10-29 18:38:30 +00:00
splunk Fix more goimports 2020-02-11 18:56:25 +01:00
syslog Fixes #41010 skip empty lines 2020-06-06 12:36:50 +08:00
templates bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
adapter.go Adds PartialLogMetadata to encode protobuf for logger plugins 2019-04-09 16:14:33 +05:00
adapter_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
copier.go Add metrics for log failures/partials 2018-05-10 17:22:37 -04:00
copier_test.go daemon/logger: normalize comment formatting 2019-11-27 15:42:27 +01:00
factory.go Improve error feedback when plugin does not implement desired interface 2020-04-21 18:06:24 -03:00
log_cache_opts.go Support configuration of log cacher. 2020-02-19 17:02:34 -05:00
logger.go Cleanup duplication in daemon files 2018-11-13 10:42:57 +08:00
logger_test.go Improve partial message support in logger 2018-04-11 13:26:28 -07:00
loginfo.go Use a regex to match labels 2019-01-16 22:17:16 +00:00
metrics.go goimports: fix imports 2019-09-18 12:56:54 +02:00
plugin.go Entropy cannot be saved 2019-06-07 11:54:45 +01:00
plugin_unix.go Fix logging plugin crash unrecoverable 2018-05-14 16:51:56 -04:00
plugin_unsupported.go Add canonical import comment 2018-02-05 16:51:57 -05:00
proxy.go Add canonical import comment 2018-02-05 16:51:57 -05:00
ring.go Update documentation for RingLogger's ring buffer 2018-05-16 18:52:50 -06:00
ring_test.go Update documentation for RingLogger's ring buffer 2018-05-16 18:52:50 -06:00