Class LogFormatter


  • public class LogFormatter
    extends Object
    This class is used to format the trace record.
    Version:
    1.0
    Author:
    K Venugopal
    • Constructor Detail

      • LogFormatter

        public LogFormatter()
    • Method Detail

      • convertToString

        public static String convertToString​(byte[] byteArray)
        Helper method to convert a byte arror to string. This is typically used for printing Xids.
        Parameters:
        byteArray - a byte[] value
        Returns:
        a String value
      • convertXidArrayToString

        public static String convertXidArrayToString​(Xid[] xidArray)
        Converts an array of xids to string that can be printed. Its a helper method.
        Parameters:
        xidArray - a Xid[] value
        Returns:
        a String value
      • convertPropsToString

        public static String convertPropsToString​(Properties prop)
        Helper method to convert properties to string.
        Parameters:
        prop - a Properties value
        Returns:
        a String value
      • getLocalizedMessage

        public static String getLocalizedMessage​(Logger logger,
                                                 String key)
        getLocalizedMessage is used to localize the messages being used in exceptions
      • getLocalizedMessage

        public static String getLocalizedMessage​(Logger logger,
                                                 String key,
                                                 Object[] args)
        getLocalizedMessage is used to localize the messages being used in exceptions with arguments inserted appropriately.