StringIndexOutOfBoundException with PatternLayout
Brought to you by:
festerwim
PatternLayout= %-5p %c %m%n
LogFile:
DEBUG [xrac763] StringTools.string2Bytes()
K7G23Z5F
DEBUG [xrac763] StringTools.string2Bytes()
Exception: StringIndexOutOfBoundException
Problem: Log4jLogFileParser.pase(File) Line: 135
Code:
int index = line.indexOf( separationCharacter, currentIndex + padding - 1 );
String priorityString = line.substring( currentIndex, index );
separationCharacter=" " could not be fount and index=-1
Solution:
String priorityString = index != -1 ? line.substring( currentIndex, index ) : line;
Logged In: YES
user_id=172636
Originator: NO
Thank you for your thourough investigation, I'll look into it.