|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectSK.gnome.dwarf.GenericService
SK.gnome.dwarf.thread.ThreadService
SK.gnome.dwarf.log.GenericLogger
SK.gnome.dwarf.log.StreamLogger
SK.gnome.dwarf.log.FileLogger
The file logger.
This logger writes the log messages to a file.
| Field Summary | |
protected boolean |
autoFlush
Whether to flush automatically the output stream. |
protected java.lang.String |
encoding
The output stream character encoding. |
protected java.io.File |
file
Physical file which the log messages will be written to. |
| Fields inherited from class SK.gnome.dwarf.log.StreamLogger |
dateTime, dateTimeFormat, extendedInfo, out |
| Fields inherited from class SK.gnome.dwarf.log.GenericLogger |
facilities, levels, lock, LOG_FACILITY_ALL |
| Fields inherited from class SK.gnome.dwarf.thread.ThreadService |
daemon, thread |
| Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
| Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
| Constructor Summary | |
FileLogger(java.lang.String name)
Creates a new FileLogger. |
|
| Method Summary | |
void |
init(Server parent)
Inititalizes the service and sets the output stream. |
java.lang.String |
report()
Returns the service report. |
void |
setAutoFlush(boolean enable)
Enables or disables the automatic flushing of the output stream. |
void |
setEncoding(java.lang.String encoding)
Sets the output stream character encoding. |
void |
setFile(java.io.File file)
Sets the file to write the log messages to. |
void |
shutdown()
Shuts down the service and closes the output stream. |
| Methods inherited from class SK.gnome.dwarf.log.StreamLogger |
setDateTime, setDateTimeFormat, setDateTimeFormat, setExtendedInfo, wouldLog, write |
| Methods inherited from class SK.gnome.dwarf.log.GenericLogger |
enableThread, getLastAccessed, log, log, loop, setFacilities, setLevels, setMarkInterval, setRepeatedInterval, start |
| Methods inherited from class SK.gnome.dwarf.thread.ThreadService |
finish, run, setDaemon, stop |
| Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.io.File file
protected boolean autoFlush
Default value: false
protected java.lang.String encoding
Default value: (system-dependent)
| Constructor Detail |
public FileLogger(java.lang.String name)
| Method Detail |
public void setFile(java.io.File file)
file - the filefilepublic void setAutoFlush(boolean enable)
enable - true to enable automatic flushingautoFlushpublic void setEncoding(java.lang.String encoding)
encoding - the Java encoding nameencoding
public void init(Server parent)
throws ServiceException
The output stream is set to the file specified by the value of the file field.
The file is opened for appending, created first if necessary. The output stream is buffered
by default. Use the setAutoFlush method to turn on or off
the automatic flushing of the output stream.
init in interface Serviceinit in class GenericServiceServiceExceptionpublic void shutdown()
shutdown in interface Serviceshutdown in class GenericLoggerpublic java.lang.String report()
Returns an information about the physical file used.
report in interface Reportable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||