Package com.nt.udc.log
Class LogUtils
java.lang.Object
com.nt.udc.log.LogUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateLogfileName(int id) static Stringstatic StringformatDate(Calendar cal) static StringformatDate(Calendar cal, int type) static StringformatTime(Calendar cal) static Stringstatic Stringstatic StringThis 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"static Stringstatic voidlogExceptionTraceMessage(File traceFile, Throwable e, String msg) static voidlogExceptionTraceMessage(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 messagestatic voidlogExceptionTraceMessage(Throwable e, String msg) static voidlogExceptionTraceMessage(Throwable e, String msg, LoggerIfc logger) static voidlogTraceMessage(File traceFile, String msg) Appends, or creates, a trace log file, and logs some user-defined trace message information, including: - User Note - Time of Messagestatic voidupdateLogfile(String text, int status, File logfile, int maxsize) static void
-
Field Details
-
END_OF_RECORD
- See Also:
-
MONTHLY
public static final int MONTHLY- See Also:
-
DAILY
public static final int DAILY- See Also:
-
-
Constructor Details
-
LogUtils
public LogUtils()
-
-
Method Details
-
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
-
updateLogfile
public static void updateLogfile(String text, int status, File logfile, int maxsize) throws IOException - Throws:
IOException
-
getFormattedDateTime
-
getSortableDateTime
-
writeln
- Throws:
IOException
-
createLogfileName
-
createLogfileName
-
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
-
logExceptionTraceMessage
-
logExceptionTraceMessage
-
logTraceMessage
Appends, or creates, a trace log file, and logs some user-defined trace message information, including: - User Note - Time of Message -
formatTime
-
formatDate
-
formatDate
-