-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add a kubernetes-log4j
module
#5718
Conversation
fb56ca6
to
f309ed9
Compare
For compatibility with |
Quality Gate failedFailed conditions 23.7% Coverage on New Code (required ≥ 80%) See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
I am converting this to draft, since I need to add tests for most of the code. Do you have an util to replace the |
I'm not sure how does this play with our own property inference logic: kubernetes-client/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java Line 409 in 315f486
I assume that for backwards-compatibility this is necessary, so I'm fine keeping it. |
Not that I know of. |
log4j/src/test/java/io/fabric8/kubernetes/log4j/lookup/KubernetesLookupTest.java
Outdated
Show resolved
Hide resolved
b2f780e
to
8024eab
Compare
Thank you for your review. I finally had some time to work on this PR. Apart from addressing your remarks above:
|
This module adds the ability to Log4j Core to use Kubernetes attributes in a configuration file. It is a cleaned-up version of the `org.apache.logging.log4j:log4j-kubernetes`. As explained in fabric8io#5682, it does make more sense to host is here since: * it only depends on a very stable `StrLookup` dependency from `log4j-core`, * the number and kind of properties available through `kubernetes-client` depend on its version.
Adds a `kubernetes.log4j.useProperties` Java system property to disable the usage of Log4j properties. Increases test coverage.
The OpenShift failures seem unrelated to my PR. |
@ppkarwasz You're right. These have been failing for a while now #5545 |
@ppkarwasz : Is it possible to add some README or user documentation in doc folder regarding how to use this? |
I have added a |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx!
Due to differences in the lifecycle of Log4j Core and Kubernetes Client, we remove `log4j-kubernetes` from the 3.x release and redirect users to Fabric8's own `kubernetes-log4j` artifact introduced in fabric8io/kubernetes-client#5718. The `log4j-kubernetes` lookup depends on: * the very stable `StrLookup` interface from Log4j Core, * the evolving set of Kubernetes metadata provided by Kubernetes Client. Therefore it makes more sense to distribute the lookup together with Kubernetes Client.
Thank you for offering to maintain this component. If some Log4j-specific issues were to appear with it, feel free to |
Will do :) Thanks for the contribution! |
Due to differences in the lifecycle of Log4j Core and Kubernetes Client, we remove `log4j-kubernetes` from the 2.x release and redirect users to Fabric8's own `kubernetes-log4j` artifact introduced in fabric8io/kubernetes-client#5718. The `log4j-kubernetes` lookup depends on: * the very stable `StrLookup` interface from Log4j Core, * the evolving set of Kubernetes metadata provided by Kubernetes Client. Therefore it makes more sense to distribute the lookup together with Kubernetes Client.
Due to differences in the lifecycle of Log4j Core and Kubernetes Client, we remove `log4j-kubernetes` from the 2.x release and redirect users to Fabric8's own `kubernetes-log4j` artifact introduced in fabric8io/kubernetes-client#5718. The `log4j-kubernetes` lookup depends on: * the very stable `StrLookup` interface from Log4j Core, * the evolving set of Kubernetes metadata provided by Kubernetes Client. Therefore it makes more sense to distribute the lookup together with Kubernetes Client.
Due to differences in the lifecycle of Log4j Core and Kubernetes Client, we remove `log4j-kubernetes` from the 3.x release and redirect users to Fabric8's own `kubernetes-log4j` artifact introduced in fabric8io/kubernetes-client#5718. The `log4j-kubernetes` lookup depends on: * the very stable `StrLookup` interface from Log4j Core, * the evolving set of Kubernetes metadata provided by Kubernetes Client. Therefore it makes more sense to distribute the lookup together with Kubernetes Client.
Description
The
kubernetes-log4j
module adds the ability to Log4j Core to use Kubernetes attributes in a configuration file.It is a cleaned-up version of the
org.apache.logging.log4j:log4j-kubernetes
, which is also released under ASL 2.0.As explained in #5682, it does make more sense to host is here since:
StrLookup
dependency fromlog4j-core
,kubernetes-client
depend on its version.Type of change
test, version modification, documentation, etc.)
Checklist