public class MonitorLoggingStore extends java.lang.Object implements LoggingStore
Considering the data we collect are not such important so far, we will discard the logs which are send back to our server not successfully including the error of non-network, in order to reduce the usage of storage.
We will fetch the logs in the disk and send them to the server once Monitor is enabled.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PERSISTED_LOGS_FILENAME |
| Modifier and Type | Method and Description |
|---|---|
static MonitorLoggingStore |
getInstance() |
java.util.Collection<ExternalLog> |
readAndClearStore()
The file will be deleted no matter if the logs are fetched from the file successfully, to avoid
that we re-send the same logs
|
void |
saveLogsToDisk(java.util.Collection<ExternalLog> logs)
We will delete the file if there is any exception thrown.
|
public static final java.lang.String PERSISTED_LOGS_FILENAME
public static MonitorLoggingStore getInstance()
public java.util.Collection<ExternalLog> readAndClearStore()
readAndClearStore in interface LoggingStorepublic void saveLogsToDisk(java.util.Collection<ExternalLog> logs)
saveLogsToDisk in interface LoggingStorelogs - Collection of Externallog which should be written into disk