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

lost logs when log rotated #154

Open
zhengxiaochuan-3 opened this issue Aug 26, 2019 · 2 comments
Open

lost logs when log rotated #154

zhengxiaochuan-3 opened this issue Aug 26, 2019 · 2 comments

Comments

@zhengxiaochuan-3
Copy link

zhengxiaochuan-3 commented Aug 26, 2019

	tailer, err := tail.TailFile(podLogPath, tail.Config{
		ReOpen:      true,
		MustExist:   true,
		Follow:      true,
		Poll:        true,
		Logger:      tail.DiscardingLogger,
		RateLimiter: lp.limiter,
		Location:    &tail.SeekInfo{0, 2},
	})

When log file being writed very fast , and rotated , will lose logs .
what I'm missed ?

@mohammed90
Copy link

I'm not sure about the internals of this library, but... I think this lightening talk by Bryan Cantrill is relevant.

@zhengxiaochuan-3
Copy link
Author

zhengxiaochuan-3 commented Aug 27, 2019

Change
POLL_DURATION
from 250 * time.Millisecond to 2*time.Millisecond helpful.

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

No branches or pull requests

2 participants