code: protected static String insertPattern(final String logFileName, final String rollPattern) {   
      int index = logFileName.lastIndexOf('.');
      if(index==-1) return logFileName + rollPattern;
      return logFileName.substring(0, index) + rollPattern + logFileName.substring(index); 
    }
docs: Merges the roll pattern name into the file name
  @param logFileName The log file name
  @param rollPattern The rolling log file appender roll pattern
  @return the merged file pattern