Package org.oddjob.logging
Interface LogArchive
- All Known Implementing Classes:
LogArchiveImpl
public interface LogArchive
A log archive. This archives events and supports listeners.
- Author:
- Rob Gordon
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(LogListener logListener, LogLevel level, long last, int history) Add a listener.Get the archive name.longGet the last message number in this archive.intGet the maximum number archive history lines supported.booleanRemove a listener.LogEvent[]retrieveEvents(long from, int max) Retrieve events from the archive.
-
Method Details
-
getLastMessageNumber
long getLastMessageNumber()Get the last message number in this archive.- Returns:
- The last message number.
-
retrieveEvents
Retrieve events from the archive. The most recent events are retrieved first.- Parameters:
from- From message numbermax- The maximum number to retreive.- Returns:
- The events.
-
addListener
Add a listener.- Parameters:
logListener- The listener.level- The level.last- The last message number this listener requires.history- The maximum lines this listener requires.
-
removeListener
Remove a listener.- Parameters:
l- The listener.
-
getArchive
String getArchive()Get the archive name.- Returns:
- The archive name. Never null.
-
getMaxHistory
int getMaxHistory()Get the maximum number archive history lines supported.- Returns:
- The number of lines.
-