-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Automatically track subloggers in allLoggers #22038
Merged
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
This PR introduces a new interface called `SubloggerAdder` for tracking allLoggers across startup phases. The interface enables us to register a single `SubloggerHook` during initial logger creation and hand off management of `allLoggers` during the three phases we need to handle: - Before `CoreConfig` is created, the `SubloggerHook` (`AppendToAllLoggers`) appends new subloggers to `ServerCommand.allLoggers`. - After `CoreConfig` is created and before `NewCore` returns, new subloggers are added to `CoreConfig.AllLoggers`. Intermediate state must also be kept in sync within NewCore to track new subloggers before we return to the server command and register the `Core.SubloggerAdder` implementation. - After `NewCore` returns to the server command, we register Core as the implementer of `ServerCommand.SubloggerAdder` ensuring that all new subloggers are appended to `Core.allLoggers`.
github-actions
bot
added
the
hashicorp-contributed-pr
If the PR is HashiCorp (i.e. not-community) contributed
label
Jul 24, 2023
mpalmi
commented
Jul 24, 2023
mpalmi
commented
Jul 24, 2023
Build Results: |
CI Results: |
ncabatoff
approved these changes
Jul 27, 2023
raskchanky
approved these changes
Aug 4, 2023
This was referenced Aug 8, 2023
hellobontempo
pushed a commit
that referenced
this pull request
Aug 18, 2023
* Automatically track subloggers in allLoggers This PR introduces a new interface called `SubloggerAdder` for tracking allLoggers across startup phases. The interface enables us to register a single `SubloggerHook` during initial logger creation and hand off management of `allLoggers` during the three phases we need to handle: - Before `CoreConfig` is created, the `SubloggerHook` (`AppendToAllLoggers`) appends new subloggers to `ServerCommand.allLoggers`. - After `CoreConfig` is created and before `NewCore` returns, new subloggers are added to `CoreConfig.AllLoggers`. Intermediate state must also be kept in sync within NewCore to track new subloggers before we return to the server command and register the `Core.SubloggerAdder` implementation. - After `NewCore` returns to the server command, we register Core as the implementer of `ServerCommand.SubloggerAdder` ensuring that all new subloggers are appended to `Core.allLoggers`. * Wire up the sublogger hook in NewTestLogger
hghaf099
added a commit
that referenced
this pull request
Nov 3, 2023
hghaf099
added a commit
that referenced
this pull request
Nov 3, 2023
hghaf099
added a commit
that referenced
this pull request
Nov 3, 2023
hghaf099
added a commit
that referenced
this pull request
Nov 3, 2023
)" into release/1.15.x (#24003) * backport of commit 9d3617e * use new logger variables in init funcs --------- Co-authored-by: Hamid Ghaf <[email protected]> Co-authored-by: hamid ghaf <[email protected]>
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.
This PR introduces a new interface called
SubloggerAdder
for trackingallLoggers across startup phases.
The interface enables us to register a single
SubloggerHook
duringinitial logger creation and hand off management of
allLoggers
duringthe three phases we need to handle:
Before
CoreConfig
is created, theSubloggerHook
(
AppendToAllLoggers
) appends new subloggers toServerCommand.allLoggers
.After
CoreConfig
is created and beforeNewCore
returns, new subloggersare added to
CoreConfig.AllLoggers
. Intermediate state must also bekept in sync within NewCore to track new subloggers before we return
to the server command and register the
Core.SubloggerAdder
implementation.
After
NewCore
returns to the server command, we register Core as theimplementer of
ServerCommand.SubloggerAdder
ensuring that all newsubloggers are appended to
Core.allLoggers
.Resolves VAULT-18012 and VAULT-18016