[Bug] Logback plugin not compatible with logback >= 1.6.0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- observability
Research direction
Start with TraceIdMDCPatternLogbackLayout.java, named in the issue, and check how it uses Logback’s defaultConverterMap against the Logback 1.6 API. Reproduce the startup failure using the documented Logback configuration and a recent Logback version; done means the application starts and logging works without the NoSuchFieldError.
Written by the indexing model from the issue text.
Description
Search before asking
- I had searched in the issues and found no similar issues.
Apache SkyWalking Component
Java Agent (apache/skywalking-java)
What happened
When using the Logback plugin (latest version) with logback 1.6.x logging will crash on startup with exception Exception in thread "main" java.lang.NoSuchFieldError: Class org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout does not have member field 'java.util.Map defaultConverterMap'
Logback configuration is adapted from the documentation :
<appender name="SKYWALKING"
class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout
class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36}-%msg%n</Pattern>
</layout>
</encoder>
</appender>
What you expected to happen
Program should work as before logback update.
How to reproduce
Just follow the official documentation at https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/application-toolkit-logback-1.x/ with a recent logback version.
Anything else
This due to https://github.com/apache/skywalking-java/blob/main/apm-application-toolkit/apm-toolkit-logback-1.x/src/main/java/org/apache/skywalking/apm/toolkit/log/logback/v1/x/mdc/TraceIdMDCPatternLogbackLayout.java using deprecated API defaultConverterMap. This API was eventually removed in 1.6.0 (see https://logback.qos.ch/notes/release_1.6.0.txt)
Fixing this will likely replacing the code with something along the lines of (NOT TESTED)
static {
PatternLayout.DEFAULT_CONVERTER_SUPPLIER_MAP.put(
"X", LogbackMDCPatternConverter::new);
PatternLayout.DEFAULT_CONVERTER_SUPPLIER_MAP.put(
"mdc", LogbackMDCPatternConverter::new);
}
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Dominant language
- Java
- Stars
- 25k
- Forks
- 6.6k
- Avg merge
- 10h 14m
- Merged PRs (30d)
- 23
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/skywalking
-
[Feature] horizon ui Logs should support horizontal scrolling; too much content requires opening each entryPossibly taken @wu-sheng claimed this 5 days ago. Openfeature UI
apache/skywalking#14118 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
database
Difficulty 4/5 3-5 days Newbie friendliness 45/100
apache/skywalking#14104 ·
Maintainers usually reply within 1 day
-
[BanyanDB] Data/Schema Import and ExportPossibly taken @mrproliu claimed this 12 days ago. Openfeature
apache/skywalking#14102 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug] BanyanDB Canopy source build fails on macOS ARM64Possibly taken @hanahmily claimed this 16 days ago. Openbug database UI
apache/skywalking#14094 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
database feature
Difficulty 5/5 Over a week Newbie friendliness 38/100
apache/skywalking#14092 ·
Maintainers usually reply within 1 day
All issues in apache/skywalking
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
bancolombia/scaffold-clean-architecture#1002 ·
Maintainers usually reply within 1 day
-
CalendarEventAttendance/get returns eventAttendanceStatus while the doc says attendanceStatusPossibly taken @chibenwa claimed this today. Openbug claude
Difficulty 1/5 Under an hour Newbie friendliness 90/100
linagora/tmail-backend#2697 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG] Case-insensitive search suggestions miss items when the JVM default locale is TurkishPossibly taken @thswlsqls claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
HMCL-dev/HMCL#6943 · 1 comment ·
Maintainers usually reply within 1 day
-
NameAllocator generates colliding identifiers with ignorable charactersPossibly taken @PHJ2000 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day