-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 tasks
belimawr
force-pushed
the
log-events-to-file
branch
3 times, most recently
from
December 21, 2023 16:55
aedb70a
to
fc0e129
Compare
belimawr
requested review from
faec and
leehinman
and removed request for
a team
December 21, 2023 16:55
cmacknz
reviewed
Dec 21, 2023
belimawr
force-pushed
the
log-events-to-file
branch
3 times, most recently
from
January 16, 2024 10:54
df34ba8
to
25f61a1
Compare
rebased onto |
cmacknz
reviewed
Jan 17, 2024
cmacknz
reviewed
Jan 24, 2024
belimawr
force-pushed
the
log-events-to-file
branch
from
January 26, 2024 11:25
d55bae1
to
24878e6
Compare
I updated the PR with the changes required for Elastic-Agent as well. |
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
I believe that's the final version. |
I found a bug, I'm working on the fix and a test for it. |
belimawr
force-pushed
the
log-events-to-file
branch
from
April 8, 2024 13:05
9d33586
to
4aabcc7
Compare
17 tasks
belimawr
force-pushed
the
log-events-to-file
branch
2 times, most recently
from
April 12, 2024 10:57
b17c07c
to
59acf2d
Compare
- Better name for some functions/variables - Allowing the typedLogger to have any output, its the caller's responsibility to restric output usage - Moved `typedLogger` to its own file - Updated tests accoringly
Add DefaultEventConfig function and correctly set some configuraiton options following the default logger configuration
Add error check in a test to address lint issues.
Break loop early whe `f.Key == t.Key` but the values are different.
belimawr
force-pushed
the
log-events-to-file
branch
from
April 24, 2024 13:04
1dca25a
to
8391f6f
Compare
Rebased onto |
💚 Build Succeeded
History
cc @belimawr |
faec
approved these changes
Apr 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
- [ ] I have added an entry inCHANGELOG.md
WithFileOrStderrOutput
to ensure it uses the correct config/level [logp] Add typed loggers allowing log entries to go to different outputs #171 (comment)Related issues