|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.sap.tc.logging.ExceptionHandling
|
+--com.sap.tc.logging.Log
|
+--com.sap.tc.logging.StreamLog
|
+--com.sap.tc.logging.FileLog
Writes log records to files.
| Field Summary | |
static int |
DEF_LIMIT
|
static int |
MODE_FILE_SET
|
static int |
MODE_MAX
|
static int |
MODE_MIN
|
static int |
MODE_SINGLE_FILE
|
static int |
NO_CNT
|
static int |
NO_LIMIT
|
| Fields inherited from class com.sap.tc.logging.Log |
LOG_ACCESSABILITY_TYPE_LOCAL_LOG, LOG_ACCESSABILITY_TYPE_NORMAL_LOG, LOG_ACCESSABILITY_TYPE_PRIVATE_LOG, STATUS_CLOSED, STATUS_INVALID, STATUS_OPENED |
| Constructor Summary | |
FileLog(java.lang.String pattern)
Configures this file log for writing to a single file. |
|
FileLog(java.lang.String pattern,
boolean append)
Same as FileLog(java.lang.String)
but configures for writing with a custom appending logic. |
|
FileLog(java.lang.String pattern,
Formatter formatter)
Same as FileLog(java.lang.String)
but configures for writing with a custom formatter. |
|
FileLog(java.lang.String pattern,
Formatter formatter,
boolean append)
Same as FileLog(java.lang.String)
but configures for writing with a custom formatter and appending logic. |
|
FileLog(java.lang.String pattern,
int limit,
int cnt)
Configures this file log for writing to a rotating set of numbered files. |
|
FileLog(java.lang.String pattern,
int limit,
int cnt,
Formatter formatter)
Same as FileLog(java.lang.String,
int,
int)
but configures for writing with a custom formatter. |
|
FileLog(java.lang.String pattern,
java.lang.String enc)
Same as FileLog(java.lang.String)
but configures for writing with a custom character encoding. |
|
FileLog(java.lang.String pattern,
java.lang.String enc,
boolean append)
Same as FileLog(java.lang.String)
but configures for writing with a custom character encoding and appending
logic. |
|
FileLog(java.lang.String pattern,
java.lang.String enc,
Formatter formatter)
Same as FileLog(java.lang.String)
but configures for writing with a custom formatter and character encoding. |
|
FileLog(java.lang.String pattern,
java.lang.String enc,
Formatter formatter,
boolean append)
Same as FileLog(java.lang.String)
but configures for writing with a custom character encoding, formatter and
appending logic. |
|
FileLog(java.lang.String pattern,
java.lang.String enc,
int limit,
int cnt)
Same as FileLog(java.lang.String,
int,
int)
but configures for writing with a custom character encoding. |
|
FileLog(java.lang.String pattern,
java.lang.String enc,
int limit,
int cnt,
Formatter formatter)
Same as FileLog(java.lang.String,
int,
int)
but configures for writing with a custom formatter and character encoding. |
|
| Method Summary | |
java.util.List |
calculateFileNames()
|
static java.util.Collection |
calculateFileNames(java.lang.String filePattern,
int fileCount)
|
boolean |
equals(java.lang.Object object)
|
java.lang.String |
findBeginningOfFileSet()
Returns the pathname string of the file from the file set, where the first (oldest) message was written. |
java.lang.String |
findEndOfFileSet()
Returns the pathname string of the file from the file set, where the last (newest) message was written. |
int |
getCnt()
Gets the max count number of rotating fileset |
java.lang.String |
getFileCurrentlyBeingWritten()
Deprecated. Same as getFileName() |
long |
getFileLength()
Returns the length of the file(s). |
java.lang.String |
getFileName()
Deprecated. A current return value is equal to the java.io.File.getPath() (path name) but from the name of the method java.io.File.getName() (file name) is expected. Please use the FileLog.getPath() for getting a path name value, and the java.io.File.getName() for getting a file name value. |
java.lang.String |
getFileNamePattern()
|
java.lang.String |
getFilePathPattern()
|
int |
getIndex()
Gets the current file index in the rotating file set |
int |
getLimit()
Gets the limit file size used for sequencing on the rotating output file |
java.lang.String |
getLogId()
Deprecated. Same as getPattern() |
int |
getMode()
Get current working mode of the FileLog return 0 == FileLog.MODE_FILE_SET 1 == FileLog.MODE_SINGLE_FILE |
java.lang.String |
getParent()
Returns the pathname string of this FileLog object's pattern's parent, or null if the pattern does not expand to a pathname
that has a parent directory. |
java.io.File |
getParentFile()
Deprecated. Use new java.io.File(FileLog.getParent()) |
java.lang.String |
getPath()
Returns the pathname string of the current file this FileLog object represent. |
java.lang.String |
getPattern()
Gets the file name pattern of this file log. |
boolean |
isAppend()
Checks whether this file log writes messages to the end of the specified file rather than the beginning. |
void |
setFormatter(Formatter formatter)
Sets the formatter that dictates the format of log records in this log. |
void |
setMode(int mode)
Set current working mode of the FileLog mode 0 == FileLog.MODE_FILE_SET 1 == FileLog.MODE_SINGLE_FILE |
void |
setRotation(int limit,
int cnt)
Set the max count number of rotating fileset and set the limit file size used for sequencing on the rotating output file This may change behaviour of the curent rotating fileset in a way: - Setting an incompatible value to the count or the limit will kill the rotating file set. |
| Methods inherited from class com.sap.tc.logging.StreamLog |
getEncoding, setEncoding |
| Methods inherited from class com.sap.tc.logging.Log |
addFilter, beGroup, beLogged, close, flush, getDescription, getEffectiveSeverity, getFilters, getFooter, getFormatter, getHeader, getLoggedCount, getLogName, getLogTypeAccessibility, getName, getNumberOfLogRecordsWritten, getOwners, getRecord, getVerInUse, isAutoFlush, isClosed, isFiltersAgreeing, isOpened, isSuppressing, open, removeFilter, removeFilters, reset, resetLoggedCount, setAutoFlush, setDescription, setEffectiveSeverity, setLogName, setLogTypeAccessibility, setName, setSuppressing, size, status, write |
| Methods inherited from class com.sap.tc.logging.ExceptionHandling |
getException, getExceptions, handleException, handleException, resetException, throwException |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sap.tc.logging.interfaces.ILog |
addFilter, beLogged, close, flush, getEffectiveSeverity, getEncoding, getFilters, getFooter, getFormatter, getHeader, getLogTypeAccessibility, getNumberOfLogRecordsWritten, isAutoFlush, isClosed, isOpened, open, removeFilter, removeFilters, setAutoFlush, setEffectiveSeverity, setEncoding, setLogTypeAccessibility, status |
| Methods inherited from interface com.sap.tc.logging.interfaces.IObjectInfo |
getDescription, getName, getVerInUse |
| Field Detail |
public static final int DEF_LIMIT
public static final int NO_LIMIT
public static final int NO_CNT
public static final int MODE_MIN
public static final int MODE_SINGLE_FILE
public static final int MODE_FILE_SET
public static final int MODE_MAX
| Constructor Detail |
public FileLog(java.lang.String pattern)
/ the local file name separator%h the home directory%t the system temporary directory%u a unique number to make the file name unique%% the percentage signpattern - File name patternFileLog(java.lang.String,
int,
int)
public FileLog(java.lang.String pattern,
boolean append)
FileLog(java.lang.String)
but configures for writing with a custom appending logic. If the specified
file exists but the second argument is false file content will
be deleted before writing.pattern - File name patternappend - If false file content will be deleted before
writing
public FileLog(java.lang.String pattern,
Formatter formatter)
FileLog(java.lang.String)
but configures for writing with a custom formatter.pattern - File name patternformatter - FormatterFileLog(java.lang.String,
int,
int,
Formatter)
public FileLog(java.lang.String pattern,
Formatter formatter,
boolean append)
FileLog(java.lang.String)
but configures for writing with a custom formatter and appending logic. If
the specified file exists but the third argument is false file
content will be deleted before writing.pattern - File name patternformatter - Formatterappend - If false file content will be deleted before
writing
public FileLog(java.lang.String pattern,
java.lang.String enc)
throws java.io.UnsupportedEncodingException
FileLog(java.lang.String)
but configures for writing with a custom character encoding.pattern - File name patternenc - Name of character encodingjava.io.UnsupportedEncodingException - Character encoding not supportedFileLog(java.lang.String,
java.lang.String,
int,
int)
public FileLog(java.lang.String pattern,
java.lang.String enc,
boolean append)
throws java.io.UnsupportedEncodingException
FileLog(java.lang.String)
but configures for writing with a custom character encoding and appending
logic. If the specified file exists but the third argument is
false file content will be deleted before writing.pattern - File name patternenc - Name of character encodingappend - If false file content will be deleted before
writingjava.io.UnsupportedEncodingException - Character encoding not supported
public FileLog(java.lang.String pattern,
java.lang.String enc,
Formatter formatter)
throws java.io.UnsupportedEncodingException
FileLog(java.lang.String)
but configures for writing with a custom formatter and character encoding.pattern - File name patternenc - Name of character encodingformatter - Formatterjava.io.UnsupportedEncodingException - Character encoding not supportedFileLog(java.lang.String,
java.lang.String,
int,
int)
public FileLog(java.lang.String pattern,
java.lang.String enc,
Formatter formatter,
boolean append)
throws java.io.UnsupportedEncodingException
FileLog(java.lang.String)
but configures for writing with a custom character encoding, formatter and
appending logic. If the specified file exists but the fourth argument is
false file content will be deleted before writing.pattern - File name patternenc - Name of character encodingformatter - Formatterappend - If false file content will be deleted before
writingjava.io.UnsupportedEncodingException - Character encoding not supported
public FileLog(java.lang.String pattern,
int limit,
int cnt)
%g can be used in the pattern where the number of
the file is supposed to go.pattern - File name patternlimit - Limit of file sizes in byte or DEF_LIMITcnt - Maximum number of files in set or NO_CNTjava.lang.IllegalArgumentException - Pattern or one, but not both, of
limit and cnt
unspecifiedFileLog(java.lang.String)
public FileLog(java.lang.String pattern,
int limit,
int cnt,
Formatter formatter)
FileLog(java.lang.String,
int,
int)
but configures for writing with a custom formatter.pattern - File name patternlimit - Limit of file sizes in byte or DEF_LIMITcnt - Maximum number of files in set or NO_CNTformatter - Formatterjava.lang.IllegalArgumentException - Pattern or one, but not both, of
limit and cnt
unspecifiedFileLog(java.lang.String, Formatter)
public FileLog(java.lang.String pattern,
java.lang.String enc,
int limit,
int cnt)
throws java.io.UnsupportedEncodingException
FileLog(java.lang.String,
int,
int)
but configures for writing with a custom character encoding.pattern - File name patternenc - Name of character encodinglimit - Limit of file sizes in byte or DEF_LIMITcnt - Maximum number of files in set or NO_CNTjava.io.UnsupportedEncodingException - Character encoding not supportedjava.lang.IllegalArgumentException - Pattern or one, but not both, of
limit and
cnt unspecifiedFileLog(java.lang.String,
java.lang.String,
int,
int)
public FileLog(java.lang.String pattern,
java.lang.String enc,
int limit,
int cnt,
Formatter formatter)
throws java.io.UnsupportedEncodingException
FileLog(java.lang.String,
int,
int)
but configures for writing with a custom formatter and character encoding.pattern - File name patternenc - Name of character encodinglimit - Limit of file sizes in byte or DEF_LIMITcnt - Maximum number of files in set or NO_CNTformatter - Formatterjava.io.UnsupportedEncodingException - Character encoding not supportedjava.lang.IllegalArgumentException - Pattern or one, but not both, of
limit and
cnt unspecifiedFileLog(java.lang.String,
java.lang.String,
int,
int)| Method Detail |
public int getMode()
public void setMode(int mode)
public void setFormatter(Formatter formatter)
setFormatter in interface ILogsetFormatter in class LogLog.getFormatter()public java.util.List calculateFileNames()
public static java.util.Collection calculateFileNames(java.lang.String filePattern,
int fileCount)
public long getFileLength()
getFileLength in interface IFileLogjava.io.IOException - if an I/O error occurs.public java.lang.String getPath()
getPath in interface IFileLogpublic java.lang.String getParent()
null if the pattern does not expand to a pathname
that has a parent directory.getParent in interface IFileLogpublic java.lang.String getPattern()
getPattern in interface IFileLogpublic java.lang.String getFilePathPattern()
public java.lang.String getFileNamePattern()
public int getLimit()
getLimit in interface IFileLogpublic int getCnt()
getCnt in interface IFileLogpublic int getIndex()
public void setRotation(int limit,
int cnt)
count <= 0 or/and limit <= 0
- Set FileLog mode to MODE_FILE_SET
- All changes are active immediately on a newly created file!public boolean isAppend()
isAppend in interface IFileLogtrue if and only if this file log writes messages to
the end of the specified file rather than the beginningpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic java.lang.String findBeginningOfFileSet()
public java.lang.String findEndOfFileSet()
public java.lang.String getFileName()
getFileName in interface IFileLogpublic java.lang.String getFileCurrentlyBeingWritten()
getFileName()
public java.io.File getParentFile()
new java.io.File(FileLog.getParent())
public java.lang.String getLogId()
getPattern()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||