Skip to content

JSON logging refactoring and X-Opaque-ID support backport(#41354)#44178

Merged
pgomulka merged 2 commits intoelastic:7.xfrom
pgomulka:bp/x-opaque-id
Jul 12, 2019
Merged

JSON logging refactoring and X-Opaque-ID support backport(#41354)#44178
pgomulka merged 2 commits intoelastic:7.xfrom
pgomulka:bp/x-opaque-id

Conversation

@pgomulka
Copy link
Copy Markdown
Contributor

@pgomulka pgomulka commented Jul 10, 2019

This is a refactor to current JSON logging to make it more open for extensions
and support for custom ES log messages used inDeprecationLogger IndexingSlowLog , SearchSLowLog
We want to include x-opaque-id in deprecation logs. The easiest way to have this as an additional JSON field instead of part of the message is to create a custom DeprecatedMessage (extends ESLogMEssage)

These messages are regular log4j messages with a text, but also carry a map of fields which can then populate the log pattern. The logic for this lives in ESJsonLayout and ESMessageFieldConverter.

Similar approach can be used to refactor IndexingSlowLog and SearchSlowLog JSON logs to contain fields previously only present as escaped JSON string in a message field.

closes #41350

@pgomulka pgomulka added :Core/Infra/Logging Log management and logging utilities backport 7x labels Jul 10, 2019
@pgomulka pgomulka self-assigned this Jul 10, 2019
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra

This is a refactor to current JSON logging to make it more open for extensions
and support for custom ES log messages used inDeprecationLogger IndexingSlowLog , SearchSLowLog
We want to include x-opaque-id in deprecation logs. The easiest way to have this as an additional JSON field instead of part of the message is to create a custom DeprecatedMessage (extends ESLogMEssage)

These messages are regular log4j messages with a text, but also carry a map of fields which can then populate the log pattern. The logic for this lives in ESJsonLayout and ESMessageFieldConverter.

Similar approach can be used to refactor IndexingSlowLog and SearchSlowLog JSON logs to contain fields previously only present as escaped JSON string in a message field.

closes elastic#41350
@pgomulka pgomulka changed the title Fix decimal point parsing for date_optional_time backport(#43859) JSON logging refactoring and X-Opaque-ID support backport(#41354) Jul 10, 2019
@pgomulka pgomulka added v7.4.0 and removed 7x labels Jul 12, 2019
@pgomulka pgomulka merged commit e23ecc5 into elastic:7.x Jul 12, 2019
pgomulka added a commit that referenced this pull request Jul 19, 2019
By mistake in 7.x types field was removed from slow logs. Types are
still present in that version, so this have to be present as a JSON
field
relates #41354
backport that was causing this #44178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Core/Infra/Logging Log management and logging utilities v7.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants