Logger createChildByLastNamePart ( final String lastPart ) { int i_index = LoggerNameUtil . getFirstSeparatorIndexOf ( lastPart ) ; if ( i_index != - 1 ) { throw new IllegalArgumentException ( "Child name [" + lastPart + " passed as parameter, may not include [" + CoreConstants . DOT + "]" ) ; } if ( childrenList == null ) { childrenList = new CopyOnWriteArrayList < Logger > ( ) ; } Logger childLogger ; if ( this . isRootLogger ( ) ) { childLogger = new Logger ( lastPart , this , this . loggerContext ) ; } else { childLogger = new Logger ( name + CoreConstants . DOT + lastPart , this , this . loggerContext ) ; } childrenList . add ( childLogger ) ; childLogger . effectiveLevelInt = this . effectiveLevelInt ; return childLogger ; }
Create a child of this logger by suffix that is the part of the name extending this logger . For example if this logger is named x . y and the lastPart is z then the created child logger will be named x . y . z .