Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-437

TargetLengthBasedClassNameAbbreviator does not work for strings with more than 12 dots (inclusive).

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.9, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15
    • Fix Version/s: 0.9.15
    • Component/s: logback-classic
    • Labels:
      None

      Description

      Please add this to TargetLengthBasedClassNameAbbreviatorTest:

      System.out.println("13");

      { // 13 dots test TargetLengthBasedClassNameAbbreviator abbreviator = new TargetLengthBasedClassNameAbbreviator(20); String name = "com.pike.test.puma.wm.isd2dita.core.g.project.server.pkg.isobjecttype.isobject.ISObjectContentGenerator"; assertEquals("c.p.t.p.w.i.c.g.o.s.r.i.ISObjectContentGenerator", abbreviator.abbreviate(name)); }

      System.out.println("12");

      { // 12 dots test TargetLengthBasedClassNameAbbreviator abbreviator = new TargetLengthBasedClassNameAbbreviator(20); String name = "com.pike.puma.wm.isd2dita.core.g.project.server.pkg.isobjecttype.isobject.ISObjectContentGenerator"; assertEquals("c.p.p.w.i.c.g.o.s.r.i.ISObjectContentGenerator", abbreviator.abbreviate(name)); }

      Logs are disappearing when this bug occurs. It throws ArrayIndexOfBounds when testing but in production logs are just skipped (thus this bug is not FATAL-CRITICAL).

      Workaround: higher the 12 dot limit.

      Better workaround: handle with strings correctly not to ses AIOB exception ever.

        Attachments

          Activity

            People

            • Assignee:
              logback-dev Logback dev list
              Reporter:
              lzap Lukas Zapletal
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: