|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.util.FileAppender
public class FileAppender
This appender logs messages to a file using JSR75 (FileConnection) The appender tracks the file size and if it exceeds a given maximum size (customizable by clients) then the current log file is renamed appending a .old to the log name and a new one is created. Therefore the maximum size on this is about 2 times the maxFileSize (this is not accurate as there is no limit on the size of the single message printed).
Constructor Summary | |
---|---|
FileAppender(java.lang.String path,
java.lang.String fileName)
Default constructor |
Method Summary | |
---|---|
void |
closeLogFile()
Close connection and streams |
void |
deleteLogFile()
Delete the log file |
LogContent |
getLogContent()
Get the whole log content for this appender |
void |
initLogFile()
Init the logger |
void |
openLogFile()
FileAppender doesn't implement this method |
void |
setContentPath(java.lang.String path)
Sets the content path. |
void |
setLogContentType(boolean memory)
Sets the content type of the log when it is retrieved via getLogContent. |
void |
setLogLevel(int level)
Perform additional actions needed when setting a new level. |
void |
setMaxFileSize(long maxFileSize)
Sets the maximum file size. |
void |
writeLogMessage(java.lang.String level,
java.lang.String msg)
FileAppender writes one message to the output file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileAppender(java.lang.String path, java.lang.String fileName)
Method Detail |
---|
public void setMaxFileSize(long maxFileSize)
maxFileSize
- the max size in bytespublic void setContentPath(java.lang.String path)
public void setLogContentType(boolean memory)
public void writeLogMessage(java.lang.String level, java.lang.String msg)
writeLogMessage
in interface Appender
public void initLogFile()
initLogFile
in interface Appender
public void openLogFile()
openLogFile
in interface Appender
public void closeLogFile()
closeLogFile
in interface Appender
public void setLogLevel(int level)
setLogLevel
in interface Appender
public void deleteLogFile()
deleteLogFile
in interface Appender
public LogContent getLogContent() throws java.io.IOException
Appender
getLogContent
in interface Appender
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |