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 String
createLogfileName
(int id) static String
static String
formatDate
(Calendar cal) static String
formatDate
(Calendar cal, int type) static String
formatTime
(Calendar cal) static String
static String
static String
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"static String
static void
logExceptionTraceMessage
(File traceFile, Throwable e, String msg) 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 messagestatic void
logExceptionTraceMessage
(Throwable e, String msg) static void
logExceptionTraceMessage
(Throwable e, String msg, LoggerIfc logger) 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 Messagestatic void
updateLogfile
(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
-