how fluentd ensure collect docker logs completely when container quit #3975
-
When a container quit, it's log file will lose also. So my question is when the container's log lose, how fluentd ensure collect the log completely? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Generally speaking, system delays the actual file deletion until the last Here is what happens to Fluentd on file deletion:
This generally works, and Fluentd can read up to the last line of |
Beta Was this translation helpful? Give feedback.
Generally speaking, system delays the actual file deletion until the last
open file handler is closed. The exact semantics varies depending on OS,
but it's (mostly) true on both Unix and Windows.
Here is what happens to Fluentd on file deletion:
Fluentd keeps open file handlers to log files that it monitors.
When Fluentd notices that some file was deleted, it thinks
"hmm, the log file must be rotated by some other program".
Fluentd switches to a rotate mode, and keeps reading from the deleted
file for 5 seconds.
Then close the file handler for the deleted file.
This generally works, and Fluentd can read up to the last line of
del…