-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Write deprecation logs to a data stream #61966
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
Write deprecation logs to a data stream #61966
Conversation
Backport of elastic#61484. Closes elastic#46106. Implement a new log4j appender for deprecation logging, in order to write logs to a dedicated data stream. This is controlled by a new setting, `cluster.deprecation_indexing.enabled`.
.../src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingComponent.java
Outdated
Show resolved
Hide resolved
Pinging @elastic/es-core-infra (:Core/Infra/Logging) |
@pgomulka would you mind reviewing this backport, please? I was caught out by |
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.
I like the idea with forward fork
backporting ecs json changes to 7.x would break the json we introduced in 7.0 so would be annoying to users
LGTM when build is green
Note that these changes were removed from |
Backport of #58924.
Closes #46106. Introduce a mechanism for writing deprecation logs to a data stream as well as to disk.
Test by running
./gradlew run
and then:This implementation reworks deprecation logging to rely on log4j by introducing filters and appenders, and a custom log level. The existing
deprecation
X-Pack plugin simply configures an extra appender to capture messages to an index. A "component" class manages most of the interface between the cluster and the appender.This approach can be extended for other types of logging, e.g. security by introducing further custom log levels.