|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.api.syslog.LogUtils
public class LogUtils
Some Logging Utilities
Field Summary | |
---|---|
static String |
AL_LOG_DIR_PREFIX
Assembly Line log directory prefix |
static String |
ROOT_LOG_DIR
Root log directory |
Constructor Summary | |
---|---|
LogUtils()
|
Method Summary | |
---|---|
static String |
cleanALLogs(String aConfigId,
String aALName,
String[] logsToBeDeleted)
Deletes all the logs which are specified in " logsToBeDeleted " array. |
static void |
cleanAllOldALLogs(Date aMinDate)
Cleans all AL logs created after the given Date |
static void |
cleanAllOldALLogs(int aKeepNum)
Cleans all AL logs and leaves only aKeepNum of them |
static void |
cleanAllOldLogs(Date aMinDate)
Cleans all logs(AL and EH) created after the given Date |
static void |
cleanAllOldLogs(int aKeepNum)
Cleans all logs(AL and EH) and leaves only aKeepNum of them |
static Boolean |
cleanOldALLogs(String aConfigId,
String aALName,
Date aMinDate)
Cleans AL logs, for a given config ID and Assembly Line name, created after the given Date |
static Boolean |
cleanOldALLogs(String aConfigId,
String aALName,
Date aMinDate,
Date aMaxDate)
Cleans AL logs, for a given config ID and Assembly Line name, created after the given Date |
static Boolean |
cleanOldALLogs(String aConfigId,
String aALName,
int aKeepNum)
Cleans AL logs, for a given config ID and Assembly Line name, and leaves only aKeepNum of them |
static String |
getALLastLogFileName(String aConfigId,
String aALName)
Retrieves the available log names, sorts them in ascending order according to the Natural Ordering and returns the last one. |
static String |
getALLog(String aConfigId,
String aALName,
String aLogFileName)
Retrieves the content of the AL log. |
static String[] |
getALLogFileNames(String aConfigId,
String aALName)
Retrieves the available component's log files names. |
static String[] |
getALLogFileNames(String aConfigId,
String aALName,
Date dDate)
Retrieves the available component's log files names after the specified date. |
static String[] |
getALLogFileNames(String aConfigId,
String aALName,
Date startDate,
Date endDate)
Retrieves the available component's log files names after the specified date. |
static String[] |
getALLogFileNames(String aConfigId,
String aALName,
int iNumber)
Retrieves the specified number of available component's log files names. |
static String |
getALLogLastChunk(String aConfigId,
String aALName,
String aLogFileName,
int aKilobytes)
This method retrieves the specified number of kylobytes from the content of a AL's log file as String. |
static String[] |
getAvailableComponentLogFiles(String aComponentTypeDir,
String aConfigId,
String aComponentName)
Retrieves the available component's log files in ascending order. |
static String[] |
getAvailableComponentLogFiles(String aComponentTypeDir,
String aConfigId,
String aComponentName,
Date dDate)
Retrieves the available component's log files after the specified date sorted in ascending order. |
static String[] |
getAvailableComponentLogFiles(String aComponentTypeDir,
String aConfigId,
String aComponentName,
int number)
Retrieves the specified number of available component's log files sorted in ascending order. |
static String |
getCleanConfigId(String aConfigId)
Replaces '/', ':', '\\', '*', '?', '"', '<', '>', '|' symbols with '_' from the given config id |
static String |
getComponentLog(String aLogFileName)
Retrieves the content of the log file. |
static String |
getComponentLogLastChunk(String aLogFileName,
int aKilobytes)
Retrieves the specified number of kilobytes from the end of the log file. |
static SystemLogAppender |
getSystemLogAppender(Log aLog)
Searches the given Log object for the System Log Appender |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ROOT_LOG_DIR
public static final String AL_LOG_DIR_PREFIX
Constructor Detail |
---|
public LogUtils()
Method Detail |
---|
public static SystemLogAppender getSystemLogAppender(Log aLog)
aLog
-
public static String getComponentLog(String aLogFileName) throws DIException
aLogFileName
- name of log file.
DIException
- if an error occurspublic static String getComponentLogLastChunk(String aLogFileName, int aKilobytes) throws DIException
aLogFileName
- name of the fileaKilobytes
- number of kilobytes
DIException
public static String[] getALLogFileNames(String aConfigId, String aALName) throws DIException
aConfigId
- the ID of the configuration the Assembly Line belongs toaALName
- the Assembly Line name
DIException
- if an error occurs.public static String[] getALLogFileNames(String aConfigId, String aALName, int iNumber) throws DIException
aConfigId
- the ID of the configuration the Assembly Line belongs toaALName
- the Assembly Line nameiNumber
- how many of the available log files you need
DIException
- if an error occurs.public static String[] getALLogFileNames(String aConfigId, String aALName, Date dDate) throws DIException
aConfigId
- the ID of the configuration the Assembly Line belongs toaALName
- the Assembly Line namedDate
- the earliest Date for the logs needed
DIException
- if an error occurs.public static String[] getALLogFileNames(String aConfigId, String aALName, Date startDate, Date endDate) throws DIException
aConfigId
- the ID of the configuration the Assembly Line belongs toaALName
- the Assembly Line namestartDate
- the start Date for the logs neededendDate
- the end Date for the logs needed
DIException
- if an error occurs.public static String getALLastLogFileName(String aConfigId, String aALName) throws DIException
aConfigId
- the ID of the configuration the Assembly Line belongs toaALName
- the Assembly Line name
DIException
public static String getALLog(String aConfigId, String aALName, String aLogFileName) throws DIException
aConfigId
- the ID of the configuration the Assembly Line belongs toaALName
- the Assembly Line nameaLogFileName
- the name of the log file
DIException
- if an error occurs.public static String getALLogLastChunk(String aConfigId, String aALName, String aLogFileName, int aKilobytes) throws DIException
aConfigId
- the ID of the configuration the Assembly Line belongs toaALName
- the Assembly Line nameaLogFileName
- the name of the log fileaKilobytes
- number of kilobytes.
DIException
public static String[] getAvailableComponentLogFiles(String aComponentTypeDir, String aConfigId, String aComponentName)
aComponentTypeDir
- the component type directoryaConfigId
- the ID of the configuration the Assembly Line belongs toaComponentName
- the component name
public static String getCleanConfigId(String aConfigId)
aConfigId
- configuration ID
public static void cleanAllOldLogs(Date aMinDate) throws DIException
aMinDate
- after this date , the log are deleted
DIException
- if an error occurs.public static void cleanAllOldLogs(int aKeepNum) throws DIException
aKeepNum
- number of logs to keep.
DIException
- if an error occurs.public static void cleanAllOldALLogs(Date aMinDate) throws DIException
aMinDate
- after this date , the log are deleted
DIException
- if an error occurs.public static void cleanAllOldALLogs(int aKeepNum) throws DIException
aKeepNum
- number of logs to keep
DIException
- if an error occurspublic static Boolean cleanOldALLogs(String aConfigId, String aALName, Date aMinDate) throws DIException
aConfigId
- configuration IDaALName
- name of the assembly lineaMinDate
- after this date , the log are deleted
DIException
public static Boolean cleanOldALLogs(String aConfigId, String aALName, Date aMinDate, Date aMaxDate) throws DIException
aConfigId
- configuration IDaALName
- name of the assembly lineaMinDate
- after this date , the log are deletedaMaxDate
- before this date , the log are deleted
DIException
public static Boolean cleanOldALLogs(String aConfigId, String aALName, int aKeepNum) throws DIException
aConfigId
- configuration IDaALName
- name of the assembly lineaKeepNum
- number of logs to keep
DIException
public static String cleanALLogs(String aConfigId, String aALName, String[] logsToBeDeleted) throws DIException
logsToBeDeleted
" array.
aConfigId
- identification of the AssemblyLine's Config Instance.aALName
- the name of the AssemblyLine whose logs will be cleaned up.logsToBeDeleted
- name of the log files which are to be deleted.
String
that holds null
if the log
files are deleted successfully; else comma separated names of the
log files which are not deleted.
DIException
- if an error occurs while deleting log files.public static String[] getAvailableComponentLogFiles(String aComponentTypeDir, String aConfigId, String aComponentName, int number)
aComponentTypeDir
- the component type directoryaConfigId
- the ID of the configuration the Assembly Line belongs toaComponentName
- the component namenumber
- how many of the available log files you need
public static String[] getAvailableComponentLogFiles(String aComponentTypeDir, String aConfigId, String aComponentName, Date dDate)
aComponentTypeDir
- the component type directoryaConfigId
- the ID of the configuration the Assembly Line belongs toaComponentName
- the component namedDate
- the earliest Date for the logs needed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |