Package org.eclipse.net4j.util.om.log
Class RollingLog
java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.net4j.util.concurrent.Worker
org.eclipse.net4j.util.om.log.RollingLog
- All Implemented Interfaces:
Iterable<RollingLog.LogLine>
,INotifier
,INotifier.INotifier2
,IDeactivateable
,ILifecycle
,ILifecycle.DeferrableActivation
,Log
- Since:
- 3.8
- Author:
- Eike Stepper
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
static final class
static class
static final class
Nested classes/interfaces inherited from class org.eclipse.net4j.util.concurrent.Worker
Worker.Terminate, Worker.WorkContext
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.DeferrableActivation
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.INotifier2
-
Field Summary
Fields inherited from class org.eclipse.net4j.util.concurrent.Worker
DEFAULT_ERROR_HANDLER, DEFAULT_TIMEOUT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
commit()
protected RollingLog.LogLine
createLogLine
(String message) protected void
protected void
final int
final String
final long
final long
protected String
long
boolean
iterator()
static CloseableIterator<RollingLog.LogLine>
protected void
load
(Properties properties) final void
static void
protected void
recovery
(Properties properties, RollingLog.LogLine logLine) protected void
save
(Properties properties) void
setWriteBulk
(boolean writeBulk) void
setWriteInterval
(long writeInterval) toString()
protected final void
work
(Worker.WorkContext context) protected void
writeLogLine
(RollingLog.LogLine logLine, PrintStream out) protected long
writeLogLines
(List<RollingLog.LogLine> logLines) protected long
writeLogLines
(List<RollingLog.LogLine> logLines, PrintStream out) Methods inherited from class org.eclipse.net4j.util.concurrent.Worker
getActivationTimeout, getDeactivationTimeout, getGlobalErrorHandler, getThreadName, getWorkerThread, handleError, isDaemon, setActivationTimeout, setDaemon, setDeactivationTimeout, setGlobalErrorHandler
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
RollingLog
-
-
Method Details
-
getLogFile
-
getLogSize
public final long getLogSize() -
getLogLineCounter
public final long getLogLineCounter() -
getFileNumber
public final int getFileNumber() -
getWriteInterval
public long getWriteInterval() -
setWriteInterval
public void setWriteInterval(long writeInterval) -
isWriteBulk
public boolean isWriteBulk() -
setWriteBulk
public void setWriteBulk(boolean writeBulk) -
log
-
commit
- Throws:
InterruptedException
-
work
-
createLogLine
-
writeLogLines
-
writeLogLines
-
writeLogLine
-
getThreadInfo
-
doActivate
- Overrides:
doActivate
in classWorker
- Throws:
Exception
-
doDeactivate
- Overrides:
doDeactivate
in classWorker
- Throws:
Exception
-
recovery
-
load
-
save
-
toString
-
iterator
- Specified by:
iterator
in interfaceIterable<RollingLog.LogLine>
-
iterator
-
main
-