Remove logging.files.suffix option and always use datetime suffixes#28927
Remove logging.files.suffix option and always use datetime suffixes#28927kvch merged 20 commits intoelastic:masterfrom
logging.files.suffix option and always use datetime suffixes#28927Conversation
|
This pull request does not have a backport label. Could you fix it @kvch? 🙏
NOTE: |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
💚 Flaky test reportTests succeeded. 🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
|
This pull request doesn't have a |
logging.files.suffix option and always use datetime suffixes
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
| interval: 0, | ||
| rotateOnStartup: true, | ||
| suffix: SuffixCount, | ||
| clock: &realClock{}, |
There was a problem hiding this comment.
injectible clock makes me happy :-)
|
/package |
…#28927) ## What does this PR do? This PR contains several improvements to the output file log rotation: * Removes suffix option as discussed offline * Filenames end in extension name so users get a hint about the contents * Removes `time.Sleep` from testing code * Datetime format no longer contains hour and minutes. In case of conflict on rotation, an index is appended to the filename. ## Why is it important? Previously, log file suffixes were configurable. Users had the option to either add the count or the datetime to the end of the log file. From now on, we only allow datetime based naming. Hence the configuration option `logging.files.suffix` is removed. Example: Filebeat is writing logs to `filebeat-20211111.ndjson` actively. Then a few minutes later it gets rotated, and the new active file becomes `filebeat-20211111-1.ndjson`. This change should help with Beats not being able to rotate files on Windows. (cherry picked from commit f2ae281)
…#28927) (#29065) ## What does this PR do? This PR contains several improvements to the output file log rotation: * Removes suffix option as discussed offline * Filenames end in extension name so users get a hint about the contents * Removes `time.Sleep` from testing code * Datetime format no longer contains hour and minutes. In case of conflict on rotation, an index is appended to the filename. ## Why is it important? Previously, log file suffixes were configurable. Users had the option to either add the count or the datetime to the end of the log file. From now on, we only allow datetime based naming. Hence the configuration option `logging.files.suffix` is removed. Example: Filebeat is writing logs to `filebeat-20211111.ndjson` actively. Then a few minutes later it gets rotated, and the new active file becomes `filebeat-20211111-1.ndjson`. This change should help with Beats not being able to rotate files on Windows. (cherry picked from commit f2ae281) Co-authored-by: Noémi Ványi <kvch@users.noreply.github.com>
…ws-on-file-changes * upstream/master: Fix discovery of Nomad allocations (elastic#28700) Add null (`\u0000`) as a valid line terminator (elastic#28998) Remove `logging.files.suffix` option and always use datetime suffixes (elastic#28927) x-pack/filebeat/module: add note for default var.input (elastic#28324) Fix AccessList & AccessMask processing in security data_stream (elastic#29016) [Metricbeat] Fix wrong mapping on "info" subkey (elastic#28782) ci: daily/weekly jobs (elastic#29050) [mergify] report open backported PRs once a week (elastic#28964)
|
@kvch The docs and config for the file output appear to not match the new behavior: beats/libbeat/_meta/config/output-file.reference.yml.tmpl Lines 18 to 20 in 3319f5b beats/libbeat/outputs/fileout/docs/fileout.asciidoc Lines 45 to 48 in 3319f5b |
|
Yes, it has been on my TODO list. I've just opened PR: #29501 |
This fixes the tests for beats and apm-server when checking for the output files. Relates to changes from elastic/beats#28927
This fixes the tests for beats when checking for the output files. Relates to changes from elastic/beats#28927 Add output ndjson suffix to APM Server output (unclear why this is necessary). * Increase timeout for output file and ensure it is written. The output file is only written when some actual values are processed. Enable self-instrumentation for APM to ensure the output file is written and increase timeout. For beats, enable metrics logging explicitly.
This fixes the tests for beats when checking for the output files. Relates to changes from elastic/beats#28927 Add output ndjson suffix to APM Server output (unclear why this is necessary). * Increase timeout for output file and ensure it is written. The output file is only written when some actual values are processed. Enable self-instrumentation for APM to ensure the output file is written and increase timeout. For beats, enable metrics logging explicitly. * Disable failing beats issues A follow up is necessary to fix and enable these tests if still useful.
What does this PR do?
This PR contains several improvements to the output file log rotation:
time.Sleepfrom testing codeWhy is it important?
Previously, log file suffixes were configurable. Users had the option to either add the count or the datetime to the end of the log file. From now on, we only allow datetime based naming. Hence the configuration option
logging.files.suffixis removed.Example:
Filebeat is writing logs to
filebeat-20211111.ndjsonactively. Then a few minutes later it gets rotated, and the new active file becomesfilebeat-20211111-1.ndjson.This change should help with Beats not being able to rotate files on Windows.
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.