-
Notifications
You must be signed in to change notification settings - Fork 0
Replace unmaintained deps: Spek2→Kotest, logback-contrib→JsonEncoder #112
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
Oops, something went wrong.
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.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: blindern/users-api
Length of output: 80
🏁 Script executed:
Repository: blindern/users-api
Length of output: 44
🏁 Script executed:
Repository: blindern/users-api
Length of output: 210
🏁 Script executed:
# Read build.gradle.kts to check logback version cat build.gradle.ktsRepository: blindern/users-api
Length of output: 2753
🏁 Script executed:
Repository: blindern/users-api
Length of output: 870
🏁 Script executed:
# Check the actual logback.xml file cat src/main/resources/logback.xmlRepository: blindern/users-api
Length of output: 398
🏁 Script executed:
Repository: blindern/users-api
Length of output: 147
🏁 Script executed:
Repository: blindern/users-api
Length of output: 44
🌐 Web query:
logback JsonEncoder 1.5 introduction release notes💡 Result:
JsonEncoderwas not first introduced in Logback 1.5.x. It first appeared in the release notes for Logback 1.3.8 / 1.4.8 (2023-06-13): “Logback now ships with JsonEncoder … in Newline delimited JSON (ndjson) format.” [1]In the Logback 1.5.0 release (2024-02-16), the release notes call out
JsonEncoderenhancements: you can enable/disable all top-level JSON members, and an optional (disabled-by-default)"formattedMessage"member was added. [1]Related 1.5.x
JsonEncodernotes include:throwable) are disabled. [1]JsonEncodermade friendlier for subclassing. [1]Source: Logback News / release notes page. [1]
🌐 Web query:
logback JsonLayout GsonFormatter vs JsonEncoder differences💡 Result:
1)
ch.qos.logback.contrib.json.classic.JsonLayout(logback-contrib)LayoutWrappingEncoder(i.e., it’s not anEncoderitself).jsonFormatter(commonlych.qos.logback.contrib.jackson.JacksonJsonFormatter). [1]JsonEncoderas an alternative. [2]2)
GsonFormatter(usually:de.gessnerfl.logback:logback-gson-formatter)JsonLayoutto serialize via Google Gson (instead of Jackson). It depends onlogback-json-coreandgson. [3]JsonLayout; it’s only the formatter used byJsonLayout.3)
ch.qos.logback.classic.encoder.JsonEncoder(built into Logback)JsonLayout: This is now the “native” Logback JSON option (no logback-contrib layout/formatter layering). [2][1]Quick “which should I use?” rule of thumb
JsonEncoder. [4][1]JsonLayoutand just want Gson instead of Jackson →JsonLayout+ Gson formatter module. [3][1]LogstashEncoder/ composite encoders). [5]Sources
[1] Logback manual – Encoders /
JsonEncodersection: https://logback.qos.ch/manual/encoders.html[2] logback-user mailing list (May 17, 2024): logback-contrib archived; suggestion to use Logback
JsonEncoder: https://mailman3.qos.ch/hyperkitty/list/logback-user%40qos.ch/thread/T2FRI3KDO3P4ASML464I77TKSBD6QFSE/[3] Maven artifact for third-party Gson formatter (deps include logback-json-core + gson): https://mvnrepository.com/artifact/de.gessnerfl.logback/logback-gson-formatter
[4] Logback Javadoc / source overview for
ch.qos.logback.classic.encoder.JsonEncoder(configurable included fields): https://logback.qos.ch/apidocs/ch.qos.logback.classic/ch/qos/logback/classic/encoder/JsonEncoder.html[5] logstash-logback-encoder README (encoders/layouts, customization, composite encoders/providers): https://github.com/logfellow/logstash-logback-encoder
LGTM — clean migration to built-in JsonEncoder.
This removes the need for the unmaintained
logback-json-classicandlogback-gson-formatterdependencies. TheJsonEncoderis built into Logback and fully supported by version1.5.29.Note: The JSON output format from
JsonEncoderwill likely differ from the previousJsonLayout+GsonFormattercombination (different field names, structure, timestamp format). If any log aggregation pipelines or dashboards depend on the specific JSON schema, they may need updating.🤖 Prompt for AI Agents