public final class PeriodicLogger
extends java.util.TimerTask
-DPeriodicLogger.message="some message here")| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MESSAGE_PROPERTY
The property for the message to log
|
static java.lang.String |
RUN_PROPERTY |
| Modifier and Type | Method and Description |
|---|---|
void |
run()
Log a message.
|
static PeriodicLogger |
runAtFixedRate(boolean isDaemon)
Create a periodic logger and schedule it to run every 15 minutes starting
at the nearest 15 minute interval.
|
void |
shutdown()
Shutdown the executor service and stop logging messages
|
public static final java.lang.String RUN_PROPERTY
public static final java.lang.String MESSAGE_PROPERTY
public void run()
run in interface java.lang.Runnablerun in class java.util.TimerTaskpublic void shutdown()
public static PeriodicLogger runAtFixedRate(boolean isDaemon)
shutdown() is called on the returned PeriodicLogger or the JVM
shuts down (if isDaemon is true)isDaemon - true if the executor service should create a daemon thread. If true,
the executor service will not keep the JVM running. If false, the executor service
will keep the JVM running, even if all other threads have terminated. It should not,
however, keep the JVM running after System.exit(int) is called.