Package com.iizix.server
Class ServerLogger
java.lang.Object
com.iizix.server.ServerLogger
The server logger implementation.
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescription- LogEntry[]- addListener- (ILogHistoryListener listener) Adds a new listener.Gets the current log file.- LogEntry[]Gets all the history entries currently available.- intGets the maximum history size.- voidInitializes the logging to file, or rotates the log file.- boolean- removeListener- (ILogHistoryListener listener) Removes a listener.
- Method Details- getCurrentLogFileGets the current log file.- Returns:
- The file for the current server log, null if not used or not yet started.
 
- getMaximumHistorySizepublic int getMaximumHistorySize()Gets the maximum history size.- Returns:
- Value range is 100 to 5000.
 
- initializeLogInitializes the logging to file, or rotates the log file.- In case of an I/O error, the logger attempts to restore the previous log file, or worst case starts writing to the console. - Throws:
- IOException- For I/O errors.
 
- getHistoryGets all the history entries currently available.- Returns:
- The array of history entries, oldest with lowest index, higher index ae newer entries.
 
- addListenerAdds a new listener. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
- listener- The listener to add.
- Returns:
- The array of history entries.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeListenerRemoves a listener.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.