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

file: allow configuration of log filename extension #68

Merged
merged 2 commits into from
Jul 25, 2022

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Jul 21, 2022

What does this PR do?

This adds the ability to configure the filename extension for logs in file.NewFileRotator and fixes a bug in the logging.

Why is it important?

Not all logs are ndjson and currently the debug log in NewFileRotator will not include the filename.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.md

Author's Checklist

  • [ ]

Related issues

@efd6 efd6 requested a review from a team as a code owner July 21, 2022 22:49
@efd6 efd6 requested review from rdner and cmacknz and removed request for a team July 21, 2022 22:49
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 21, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-07-23T03:18:22.156+0000

  • Duration: 9 min 20 sec

Test stats 🧪

Test Results
Failed 0
Passed 1078
Skipped 6
Total 1084

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@cmacknz cmacknz requested a review from belimawr July 22, 2022 13:41
Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would log the extension with the filename in the debug log:

r.log.Debugw("Initialized file rotator",
"filename", r.filename,
"max_size_bytes", r.maxSizeBytes,
"max_backups", r.maxBackups,
"permissions", r.permissions,
)

Otherwise LGTM.

@efd6
Copy link
Contributor Author

efd6 commented Jul 23, 2022

@cmacknz I don't have write access on this repo. Would you merge please.

@belimawr belimawr merged commit dbea8c3 into elastic:main Jul 25, 2022
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.

4 participants