[logback-dev] [JIRA] Commented: (LBCLASSIC-110) TargetLengthBasedClassNameAbbreviator does not work for strings with more than 12 dots (inclusive).

Lukas Zapletal (JIRA) noreply-jira at qos.ch
Mon Jun 22 13:52:10 CEST 2009


    [ http://jira.qos.ch/browse/LBCLASSIC-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11206#action_11206 ] 

Lukas Zapletal commented on LBCLASSIC-110:
------------------------------------------

I am getting the issue with version 0.9.15 and this class

com.pike.puma.wm.isd2dita.core.g.project.server.pkg.isobjecttype.isobject.ISObjectContentGenerator

and this configuration (logger name abbreviator se to 20):

<configuration>
 name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<layout class="ch.qos.logback.classic.PatternLayout">
			<Pattern>%d{HH:mm:ss} [%thread] %-5level %logger{20} - %msg%n</Pattern>
		</layout>
	</appender>
	<root>
		<level value="DEBUG" />
		<appender-ref ref="STDOUT" />
	</root>
</configuration>

> TargetLengthBasedClassNameAbbreviator does not work for strings with more than 12 dots (inclusive).
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LBCLASSIC-110
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-110
>             Project: logback-classic
>          Issue Type: Bug
>          Components: appender
>    Affects Versions: 0.9.9, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15
>            Reporter: Lukas Zapletal
>            Assignee: Logback dev list
>             Fix For: 0.9.15
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list