Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug] Logback plugin not compatible with logback >= 1.6.0

Open Beginner friendly
#14,120 0 comments 0 reactions 0 assignees View on GitHub

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

bug
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
Dominant language
Java
Stars
25k
Forks
6.6k
Avg merge
10h 14m
Merged PRs (30d)
23

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/skywalking

All issues in apache/skywalking

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.