Class LogUtils

java.lang.Object
com.nt.udc.log.LogUtils

public class LogUtils extends Object
  • Field Details

  • Constructor Details

    • LogUtils

      public LogUtils()
  • Method Details

    • getUniqueName

      public static String getUniqueName()
      This method gets the current time and formats it into a string that is usable in a legal file path The equivalent SimpleDateFormat format is: "MMM_d__yyyy_h_mm_ss_SSS" The value returned is "MMM_d__yyyy_h_mm_ss_SSS_32digitAlphaNumericUniqueNo"
    • getUniqueRandomString

      public static String getUniqueRandomString()
    • updateLogfile

      public static void updateLogfile(String text, int status, File logfile, int maxsize) throws IOException
      Throws:
      IOException
    • getFormattedDateTime

      public static String getFormattedDateTime()
    • getSortableDateTime

      public static String getSortableDateTime()
    • writeln

      public static void writeln(String text, File file) throws IOException
      Throws:
      IOException
    • createLogfileName

      public static String createLogfileName(String id)
    • createLogfileName

      public static String createLogfileName(int id)
    • logExceptionTraceMessage

      public static void logExceptionTraceMessage(File traceFile, Throwable e, String msg, LoggerIfc logger)
      Appends (or creates) a trace log file, and logs some exception-related information, including: - Exception message - Time of exception - Stack trace - Optional user-defined message
    • logExceptionTraceMessage

      public static void logExceptionTraceMessage(File traceFile, Throwable e, String msg)
    • logExceptionTraceMessage

      public static void logExceptionTraceMessage(Throwable e, String msg, LoggerIfc logger)
    • logExceptionTraceMessage

      public static void logExceptionTraceMessage(Throwable e, String msg)
    • logTraceMessage

      public static void logTraceMessage(File traceFile, String msg)
      Appends, or creates, a trace log file, and logs some user-defined trace message information, including: - User Note - Time of Message
    • formatTime

      public static String formatTime(Calendar cal)
    • formatDate

      public static String formatDate(Calendar cal, int type)
    • formatDate

      public static String formatDate(Calendar cal)