-
Notifications
You must be signed in to change notification settings - Fork 282
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
Switch to log4j logger #1751
Switch to log4j logger #1751
Conversation
In OpenSearch 1.3.0 we removed an explicit dependency on log4j opensearch-project#1563 this caused the log4j-slf4j-impl-X.XX.X.jar file no longer to be included in the plugin. When the plugin started up the default no-op logger was used instead. This prevented the security plugin from logging anything, yikes. When looking at the other opensearch plugins, none of them use slf4. Rather than continue using a seperate logging process, moving to the standard log4j Logger/LogManager. Tested this change on 2.0.0-alpha distribution and logging works as expected. Signed-off-by: Peter Nied <[email protected]>
@cliu123 This seems like a bad bug to keep in the 1.3.X release line, what do you think about backporting this change? |
Is this basically reverting the commit? If that's the case, @davidlago has more context on the commit being reverted. Would you plesae provide the context of the original commit? |
#1563 removed the explicit dependency and lets core provide it instead. SLF4J provides that layer of abstraction, and the thrust behind that PR was to get us off of declaring it as an explicit dependency so that if new bugs/issues are found, only core needs to update the jar they provide and we should be all set. I agree that this should be backported to the 1.x line. @peternied is this something we can fix without adding back the dependency? (i.e. figure out why the jar is not being picked up from core and address that instead?) |
Codecov Report
@@ Coverage Diff @@
## main #1751 +/- ##
============================================
+ Coverage 60.40% 60.42% +0.02%
- Complexity 3196 3197 +1
============================================
Files 253 253
Lines 18093 18093
Branches 3245 3245
============================================
+ Hits 10929 10933 +4
+ Misses 5583 5579 -4
Partials 1581 1581
Continue to review full report at Codecov.
|
Yes the dependency can stay out as the library is available from OpenSearch's classpath. |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-1751-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 54a920b20bd520f25aef328c1bb4997b325f46ce
# Push it to GitHub
git push --set-upstream origin backport/backport-1751-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.3 1.3
# Navigate to the new working tree
cd .worktrees/backport-1.3
# Create a new branch
git switch --create backport/backport-1751-to-1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 54a920b20bd520f25aef328c1bb4997b325f46ce
# Push it to GitHub
git push --set-upstream origin backport/backport-1751-to-1.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.3 Then, create a pull request where the |
Created #1753 to backport this change |
In OpenSearch 1.3.0 we removed an explicit dependency on log4j opensearch-project#1563 this caused the log4j-slf4j-impl-X.XX.X.jar file no longer to be included in the plugin. When the plugin started up the default no-op logger was used instead. This prevented the security plugin from logging anything, yikes. When looking at the other opensearch plugins, none of them use slf4. Rather than continue using a seperate logging process, moving to the standard log4j Logger/LogManager. Tested this change on 2.0.0-alpha distribution and logging works as expected. Signed-off-by: Peter Nied <[email protected]> (cherry picked from commit 54a920b)
In OpenSearch 1.3.0 we removed an explicit dependency on log4j opensearch-project#1563 this caused the log4j-slf4j-impl-X.XX.X.jar file no longer to be included in the plugin. When the plugin started up the default no-op logger was used instead. This prevented the security plugin from logging anything, yikes. When looking at the other opensearch plugins, none of them use slf4. Rather than continue using a seperate logging process, moving to the standard log4j Logger/LogManager. Tested this change on 2.0.0-alpha distribution and logging works as expected. Signed-off-by: Peter Nied <[email protected]> (cherry picked from commit 54a920b)
* Switch to log4j logger (#1751) In OpenSearch 1.3.0 we removed an explicit dependency on log4j #1563 this caused the log4j-slf4j-impl-X.XX.X.jar file no longer to be included in the plugin. When the plugin started up the default no-op logger was used instead. This prevented the security plugin from logging anything, yikes. When looking at the other opensearch plugins, none of them use slf4. Rather than continue using a seperate logging process, moving to the standard log4j Logger/LogManager. Tested this change on 2.0.0-alpha distribution and logging works as expected. Signed-off-by: Peter Nied <[email protected]> (cherry picked from commit 54a920b) * Fix 2 files that missed the update Signed-off-by: Peter Nied <[email protected]> * Adds logger to missed files Signed-off-by: Darshit Chanpura <[email protected]> Co-authored-by: Peter Nied <[email protected]>
In OpenSearch 1.3.0 we removed an explicit dependency on log4j opensearch-project#1563 this caused the log4j-slf4j-impl-X.XX.X.jar file no longer to be included in the plugin. When the plugin started up the default no-op logger was used instead. This prevented the security plugin from logging anything, yikes. When looking at the other opensearch plugins, none of them use slf4. Rather than continue using a seperate logging process, moving to the standard log4j Logger/LogManager. Tested this change on 2.0.0-alpha distribution and logging works as expected. Signed-off-by: Peter Nied <[email protected]>
Description
In OpenSearch 1.3.0 we removed an explicit dependency on log4j
#1563 this caused the
log4j-slf4j-impl-X.XX.X.jar file no longer to be included in the plugin.
When the plugin started up the default no-op logger was used instead.
This prevented the security plugin from logging anything, yikes.
When looking at the other opensearch plugins, none of them use slf4.
Rather than continue using a seperate logging process, moving to the
standard log4j Logger/LogManager.
Tested this change on 2.0.0-alpha distribution and logging works as
expected.
Issues Resolved
Testing
Downloaded the min versions of opensearch 2.0.0-alpha1, then build the plugin, verified that the log output included lines like
[2022-04-07T18:07:42,441][INFO ][o.o.s.OpenSearchSecurityPlugin] [dev-dsk-petern-1e-d7e6bfc0.us-east-1.amazon.com] 0 OpenSearch Security modules loaded so far: []
that were previously not presentCheck List
New functionality includes testingNew functionality has been documentedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.