Package com.jalios.jstore.jsync
Class JSyncLogger
java.lang.Object
com.jalios.jstore.jsync.JSyncLogger
- All Implemented Interfaces:
JSyncConstants,JaliosConstants
This class writes logs JSyncReplica actions such as join, disjoin, update, etc.
- Author:
- Olivier Dedieu
-
Field Summary
Fields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEARFields inherited from interface com.jalios.jstore.jsync.JSyncConstants
HEADER_SECRET, SC_BAD_ADDRESS, SC_BAD_LEADER, SC_BAD_LOG_PREFIX, SC_BAD_MESSAGE, SC_CHECK_COMMIT_WORK_FAILED, SC_COMMIT_WORK_FAILED, SC_DISCONNECTED, SC_EMPTY_PT, SC_INCOMPATIBLE_LOG_FORMAT, SC_INTERNAL_SERVER_ERROR, SC_JOIN_REJECTED, SC_LEADER_CANNOT_JOIN, SC_NO_ACK, SC_NO_SEND, SC_OK, SC_UNKNOWN, SC_UNKNOWN_URID, SC_URID_ALREADY_ADDED, STATUS_DISCONNECTED, STATUS_LEADER, STATUS_LONE, STATUS_MEMBER, STATUS_SUBLEADER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(JSyncEvent event) Add a JSyncEvent in the loggetLogFile(Date date) Return the log file for the given dategetLogFileList(Date beginDate, Date endDate) Return a list of log file for the given date rangegetStatusLabel(int sc, Locale locale) Return the label of the given status code
-
Constructor Details
-
JSyncLogger
Constructs a new JSyncLogger- Parameters:
logDir- the log directory- Since:
- jcms-4.1
-
-
Method Details
-
getLogFile
Return the log file for the given date- Parameters:
date- the date- Returns:
- the log file for the given date
- Since:
- jcms-4.1
-
getLogFileList
Return a list of log file for the given date range- Parameters:
beginDate- the begin dateendDate- the end date- Returns:
- a List of File objects
- Since:
- jcms-4.1
-
getStatusLabel
Return the label of the given status code- Parameters:
sc- the status code (must be a new status code value (e.g. 1101, 1200, ...)locale- the locale to be used- Returns:
- the status label
- Since:
- jcms-4.1
-
add
Add a JSyncEvent in the log- Parameters:
event- the JSyncEvent- Since:
- jcms-8.0.2
-