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

in_tail: Add debug log for pos file compaction #4228

Merged

Conversation

daipom
Copy link
Contributor

@daipom daipom commented Jul 6, 2023

Which issue(s) this PR fixes:

What this PR does / why we need it:
Add debug logs about pos file compaction like the following.

[debug]: ... Compacted entries: [...]
[debug]: ... Remove missing entries. existing_targets=[...] entries_after_removing=[...]

Example on the startup.

2023-07-06 22:55:49 +0900 [info]: #0 fluent/log.rb:360:info: starting fluentd worker pid=1347502 ppid=1347482 worker=0
2023-07-06 22:55:49 +0900 [debug]: #0 fluent/log.rb:339:debug: Compacted entries: [101581096, 101581105]
2023-07-06 22:55:49 +0900 [debug]: #0 fluent/log.rb:339:debug: Remove missing entries. existing_targets=[101581096, 101581105] entries_after_removing=[101581096, 101581105]
2023-07-06 22:55:49 +0900 [debug]: #0 fluent/log.rb:339:debug: tailing paths: target = /test/fluentd/input4/test.log,/test/fluentd/input4/test.log.1 | existing = 
2023-07-06 22:55:49 +0900 [info]: #0 fluent/log.rb:360:info: following tail of /test/fluentd/input4/test.log
2023-07-06 22:55:49 +0900 [info]: #0 fluent/log.rb:360:info: following tail of /test/fluentd/input4/test.log.1
2023-07-06 22:55:49 +0900 [info]: #0 fluent/log.rb:360:info: fluentd worker is now running worker=0

In discussion #4212, we are in trouble because we can't know the status of pos file on startup.
We need such logs to know if in_tail reads the pos file and if in_tail finds out the existing target files as expected at startup.

Docs Changes:
No need.

Release Note:
Same as the title.

These logs would be useful to check the status of pos file on
startup.

    [debug]: ... Compacted entries: [...]
    [debug]: ... Remove missing entries. existing_targets=[...]
    entries_after_removing=[...]

Signed-off-by: Daijiro Fukuda <[email protected]>
@ashie ashie merged commit aaa40f7 into fluent:master Jul 7, 2023
@ashie
Copy link
Member

ashie commented Jul 7, 2023

👍

@daipom daipom deleted the in_tail-add-debug-log-for-pos-file-compaction branch July 7, 2023 04:18
@daipom
Copy link
Contributor Author

daipom commented Jul 7, 2023

Thanks for your review!

@daipom daipom added this to the v1.16.2 milestone Oct 10, 2023
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.

2 participants