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

[logp] Add typed loggers allowing log entries to go to different outputs #171

Merged
merged 26 commits into from
Apr 25, 2024

Conversation

belimawr
Copy link
Contributor

@belimawr belimawr commented Dec 20, 2023

What does this PR do?

This commit introduces a typedLogger that allows a log entry to be directed to different outputs when a configurable key/value are present in the log fields.

This enables Beats (standalone and running under Elastic-Agent) to log event data to a separate log file.

Why is it important?

It is required by:

Checklist

Related issues

@belimawr belimawr added the Team:Elastic-Agent Label for the Agent team label Dec 20, 2023
@belimawr belimawr self-assigned this Dec 20, 2023
@belimawr belimawr force-pushed the log-events-to-file branch 3 times, most recently from aedb70a to fc0e129 Compare December 21, 2023 16:55
@belimawr belimawr marked this pull request as ready for review December 21, 2023 16:55
@belimawr belimawr requested a review from a team as a code owner December 21, 2023 16:55
@belimawr belimawr requested review from faec and leehinman and removed request for a team December 21, 2023 16:55
logp/core.go Outdated Show resolved Hide resolved
@belimawr belimawr requested a review from cmacknz January 16, 2024 07:37
@belimawr belimawr force-pushed the log-events-to-file branch 3 times, most recently from df34ba8 to 25f61a1 Compare January 16, 2024 10:54
@belimawr
Copy link
Contributor Author

rebased onto main, force push.

logp/core.go Outdated Show resolved Hide resolved
@belimawr belimawr requested a review from cmacknz January 22, 2024 15:05
logp/core.go Outdated Show resolved Hide resolved
logp/core_test.go Show resolved Hide resolved
logp/core_test.go Outdated Show resolved Hide resolved
@belimawr
Copy link
Contributor Author

I updated the PR with the changes required for Elastic-Agent as well.

@belimawr belimawr changed the title [logp] Allow a logger to change its output [logp] Add typed loggers allowing log entries to go to different outputs Jan 26, 2024
@belimawr belimawr requested a review from cmacknz January 26, 2024 12:16
@belimawr
Copy link
Contributor Author

I believe that's the final version.

@belimawr
Copy link
Contributor Author

I found a bug, I'm working on the fix and a test for it.

@belimawr belimawr force-pushed the log-events-to-file branch from 9d33586 to 4aabcc7 Compare April 8, 2024 13:05
@belimawr belimawr force-pushed the log-events-to-file branch 2 times, most recently from b17c07c to 59acf2d Compare April 12, 2024 10:57
@belimawr belimawr force-pushed the log-events-to-file branch from 1dca25a to 8391f6f Compare April 24, 2024 13:04
@belimawr
Copy link
Contributor Author

Rebased onto main

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @belimawr

@belimawr belimawr merged commit f4cb3fd into elastic:main Apr 25, 2024
6 checks passed
@belimawr belimawr deleted the log-events-to-file branch April 25, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants