public class RollingLog extends Worker implements Log, java.lang.Iterable<RollingLog.LogLine>
Modifier and Type | Class and Description |
---|---|
static class |
RollingLog.LogLine |
static class |
RollingLog.PropertiesEvent |
static class |
RollingLog.RecoveryEvent |
static class |
RollingLog.RollingLogEvent |
static class |
RollingLog.SplitEvent |
Worker.WorkContext
ILifecycle.DeferrableActivation
DEFAULT_ERROR_HANDLER, DEFAULT_TIMEOUT
Constructor and Description |
---|
RollingLog(java.lang.String logFile,
long logSize,
boolean append) |
Modifier and Type | Method and Description |
---|---|
void |
commit() |
protected RollingLog.LogLine |
createLogLine(java.lang.String message) |
protected void |
doActivate() |
protected void |
doDeactivate() |
int |
getFileNumber() |
java.lang.String |
getLogFile() |
long |
getLogLineCounter() |
long |
getLogSize() |
protected java.lang.String |
getThreadInfo() |
long |
getWriteInterval() |
boolean |
isWriteBulk() |
CloseableIterator<RollingLog.LogLine> |
iterator() |
static CloseableIterator<RollingLog.LogLine> |
iterator(java.lang.String logFile) |
protected void |
load(java.util.Properties properties) |
void |
log(java.lang.String message) |
static void |
main(java.lang.String[] args) |
protected void |
recovery(java.util.Properties properties,
RollingLog.LogLine logLine) |
protected void |
save(java.util.Properties properties) |
void |
setWriteBulk(boolean writeBulk) |
void |
setWriteInterval(long writeInterval) |
java.lang.String |
toString() |
protected void |
work(Worker.WorkContext context) |
protected void |
writeLogLine(RollingLog.LogLine logLine,
java.io.PrintStream out) |
protected long |
writeLogLines(java.util.List<RollingLog.LogLine> logLines) |
protected long |
writeLogLines(java.util.List<RollingLog.LogLine> logLines,
java.io.PrintStream out) |
getActivationTimeout, getDeactivationTimeout, getGlobalErrorHandler, getThreadName, getWorkerThread, handleError, isDaemon, setActivationTimeout, setDaemon, setDeactivationTimeout, setGlobalErrorHandler
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, getListeners, hasListeners, removeListener
public RollingLog(java.lang.String logFile, long logSize, boolean append)
public final java.lang.String getLogFile()
public final long getLogSize()
public final long getLogLineCounter()
public final int getFileNumber()
public long getWriteInterval()
public void setWriteInterval(long writeInterval)
public boolean isWriteBulk()
public void setWriteBulk(boolean writeBulk)
public final void commit() throws java.lang.InterruptedException
java.lang.InterruptedException
protected final void work(Worker.WorkContext context) throws java.lang.Exception
protected RollingLog.LogLine createLogLine(java.lang.String message)
protected long writeLogLines(java.util.List<RollingLog.LogLine> logLines)
protected long writeLogLines(java.util.List<RollingLog.LogLine> logLines, java.io.PrintStream out)
protected void writeLogLine(RollingLog.LogLine logLine, java.io.PrintStream out)
protected java.lang.String getThreadInfo()
protected void doActivate() throws java.lang.Exception
doActivate
in class Worker
java.lang.Exception
protected void doDeactivate() throws java.lang.Exception
doDeactivate
in class Worker
java.lang.Exception
protected void recovery(java.util.Properties properties, RollingLog.LogLine logLine)
protected void load(java.util.Properties properties)
protected void save(java.util.Properties properties)
public final CloseableIterator<RollingLog.LogLine> iterator()
iterator
in interface java.lang.Iterable<RollingLog.LogLine>
public static CloseableIterator<RollingLog.LogLine> iterator(java.lang.String logFile)
public static void main(java.lang.String[] args)
Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html