|
||||||||||
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 java.lang.String |
AL_LOG_DIR_PREFIX
Assembly Line log directory prefix |
static java.lang.String |
ROOT_LOG_DIR
Root log directory |
Constructor Summary | |
---|---|
LogUtils()
|
Method Summary | |
---|---|
static java.lang.String |
cleanALLogs(java.lang.String aConfigId,
java.lang.String aALName,
java.lang.String[] logsToBeDeleted)
Deletes all the logs which are specified in " logsToBeDeleted " array. |
static void |
cleanAllOldALLogs(java.util.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(java.util.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 java.lang.Boolean |
cleanOldALLogs(java.lang.String aConfigId,
java.lang.String aALName,
java.util.Date aMinDate)
Cleans AL logs, for a given config ID and Assembly Line name, created after the given Date |
static java.lang.Boolean |
cleanOldALLogs(java.lang.String aConfigId,
java.lang.String aALName,
java.util.Date aMinDate,
java.util.Date aMaxDate)
Cleans AL logs, for a given config ID and Assembly Line name, created after the given Date |
static java.lang.Boolean |
cleanOldALLogs(java.lang.String aConfigId,
java.lang.String aALName,
int aKeepNum)
Cleans AL logs, for a given config ID and Assembly Line name, and leaves only aKeepNum of them |
static java.lang.String |
getALLastLogFileName(java.lang.String aConfigId,
java.lang.String aALName)
Retrieves the available log names, sorts them in ascending order according to the Natural Ordering and returns the last one. |
static java.lang.String |
getALLog(java.lang.String aConfigId,
java.lang.String aALName,
java.lang.String aLogFileName)
Retrieves the content of the AL log. |
static java.lang.String[] |
getALLogFileNames(java.lang.String aConfigId,
java.lang.String aALName)
Retrieves the available component's log files names. |
static java.lang.String[] |
getALLogFileNames(java.lang.String aConfigId,
java.lang.String aALName,
java.util.Date dDate)
Retrieves the available component's log files names after the specified date. |
static java.lang.String[] |
getALLogFileNames(java.lang.String aConfigId,
java.lang.String aALName,
java.util.Date startDate,
java.util.Date endDate)
Retrieves the available component's log files names after the specified date. |
static java.lang.String[] |
getALLogFileNames(java.lang.String aConfigId,
java.lang.String aALName,
int iNumber)
Retrieves the specified number of available component's log files names. |
static java.lang.String |
getALLogLastChunk(java.lang.String aConfigId,
java.lang.String aALName,
java.lang.String aLogFileName,
int aKilobytes)
This method retrieves the specified number of kylobytes from the content of a AL's log file as String. |
static java.lang.String[] |
getAvailableComponentLogFiles(java.lang.String aComponentTypeDir,
java.lang.String aConfigId,
java.lang.String aComponentName)
Retrieves the available component's log files in ascending order. |
static java.lang.String[] |
getAvailableComponentLogFiles(java.lang.String aComponentTypeDir,
java.lang.String aConfigId,
java.lang.String aComponentName,
java.util.Date dDate)
Retrieves the available component's log files after the specified date sorted in ascending order. |
static java.lang.String[] |
getAvailableComponentLogFiles(java.lang.String aComponentTypeDir,
java.lang.String aConfigId,
java.lang.String aComponentName,
int number)
Retrieves the specified number of available component's log files sorted in ascending order. |
static java.lang.String |
getCleanConfigId(java.lang.String aConfigId)
Replaces '/', ':', '\\', '*', '?', '"', '<', '>', '|' symbols with '_' from the given config id |
static java.lang.String |
getComponentLog(java.lang.String aLogFileName)
Retrieves the content of the log file. |
static java.lang.String |
getComponentLogLastChunk(java.lang.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 java.lang.String ROOT_LOG_DIR
public static final java.lang.String AL_LOG_DIR_PREFIX
Constructor Detail |
---|
public LogUtils()
Method Detail |
---|
public static SystemLogAppender getSystemLogAppender(Log aLog)
aLog
-
public static java.lang.String getComponentLog(java.lang.String aLogFileName) throws DIException
aLogFileName
- name of log file.
DIException
- if an error occurspublic static java.lang.String getComponentLogLastChunk(java.lang.String aLogFileName, int aKilobytes) throws DIException
aLogFileName
- name of the fileaKilobytes
- number of kilobytes
DIException
public static java.lang.String[] getALLogFileNames(java.lang.String aConfigId, java.lang.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 java.lang.String[] getALLogFileNames(java.lang.String aConfigId, java.lang.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 java.lang.String[] getALLogFileNames(java.lang.String aConfigId, java.lang.String aALName, java.util.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 java.lang.String[] getALLogFileNames(java.lang.String aConfigId, java.lang.String aALName, java.util.Date startDate, java.util.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 java.lang.String getALLastLogFileName(java.lang.String aConfigId, java.lang.String aALName) throws DIException
aConfigId
- the ID of the configuration the Assembly Line belongs toaALName
- the Assembly Line name
DIException
public static java.lang.String getALLog(java.lang.String aConfigId, java.lang.String aALName, java.lang.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 java.lang.String getALLogLastChunk(java.lang.String aConfigId, java.lang.String aALName, java.lang.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 java.lang.String[] getAvailableComponentLogFiles(java.lang.String aComponentTypeDir, java.lang.String aConfigId, java.lang.String aComponentName)
aComponentTypeDir
- the component type directoryaConfigId
- the ID of the configuration the Assembly Line belongs toaComponentName
- the component name
public static java.lang.String getCleanConfigId(java.lang.String aConfigId)
aConfigId
- configuration ID
public static void cleanAllOldLogs(java.util.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(java.util.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 java.lang.Boolean cleanOldALLogs(java.lang.String aConfigId, java.lang.String aALName, java.util.Date aMinDate) throws DIException
aConfigId
- configuration IDaALName
- name of the assembly lineaMinDate
- after this date , the log are deleted
DIException
public static java.lang.Boolean cleanOldALLogs(java.lang.String aConfigId, java.lang.String aALName, java.util.Date aMinDate, java.util.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 java.lang.Boolean cleanOldALLogs(java.lang.String aConfigId, java.lang.String aALName, int aKeepNum) throws DIException
aConfigId
- configuration IDaALName
- name of the assembly lineaKeepNum
- number of logs to keep
DIException
public static java.lang.String cleanALLogs(java.lang.String aConfigId, java.lang.String aALName, java.lang.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 java.lang.String[] getAvailableComponentLogFiles(java.lang.String aComponentTypeDir, java.lang.String aConfigId, java.lang.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 java.lang.String[] getAvailableComponentLogFiles(java.lang.String aComponentTypeDir, java.lang.String aConfigId, java.lang.String aComponentName, java.util.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 |