Example #1
0
 /**
  * getLocalizedMessage is used to localize the messages being used in exceptions with arguments
  * inserted appropriately.
  */
 public static String getLocalizedMessage(Logger logger, String key, Object[] args) {
   try {
     ResourceBundle rb = logger.getResourceBundle();
     String message = rb.getString(key);
     return MessageFormat.format(message, args);
   } catch (Exception ex) {
     logger.log(Level.FINE, "JTS:Error while localizing the log message");
     return key;
   }
 }