Package com.logviewer.formats.utils
Class LvLayoutLog4jISO8601Date
java.lang.Object
com.logviewer.formats.utils.LvLayoutDateNode
com.logviewer.formats.utils.LvLayoutLog4jISO8601Date
- All Implemented Interfaces:
LvLayoutNode,Cloneable
Date in ISO8601 format. log4J_1 and log2J_2 format ISO8601 in different way
Log4j_1 : %d{ISO8601} = 2011-10-13 18:33:45,000
Log4j_2 : %d{ISO8601} = 2011-10-13T18:33:45,000
This class support both of those formats.
LvLayoutLog4jISO8601Date works much faster than
SimpleDateFormat-
Field Summary
Fields inherited from class com.logviewer.formats.utils.LvLayoutDateNode
currentDate, locale, zoneFields inherited from interface com.logviewer.formats.utils.LvLayoutNode
PARSE_FAILED, SKIP_FIELD -
Constructor Summary
ConstructorsConstructorDescriptionLvLayoutLog4jISO8601Date(boolean hasMilliseconds) LvLayoutLog4jISO8601Date(int milliseconds, boolean hasTimezone) -
Method Summary
Modifier and TypeMethodDescriptionclone()static LvLayoutLog4jISO8601DatefromPattern(String pattern) booleanisFull()intMethods inherited from class com.logviewer.formats.utils.LvLayoutDateNode
getCurrentDate, getZone, withLocale, withTimeZoneMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.logviewer.formats.utils.LvLayoutNode
getValueStart, removeSpacesBefore
-
Constructor Details
-
LvLayoutLog4jISO8601Date
public LvLayoutLog4jISO8601Date(boolean hasMilliseconds) -
LvLayoutLog4jISO8601Date
public LvLayoutLog4jISO8601Date(int milliseconds, boolean hasTimezone)
-
-
Method Details
-
parse
- Parameters:
s- a string to parse.offset- begin of parsable text partend- end of parsable text part- Returns:
- the end of parsed field, or
LvLayoutNode.SKIP_FIELDif the part is not present, orLvLayoutNode.PARSE_FAILEDif the string is not a valid log line.
-
isFull
public boolean isFull()- Specified by:
isFullin classLvLayoutDateNode
-
fromPattern
-
clone
- Specified by:
clonein interfaceLvLayoutNode- Overrides:
clonein classLvLayoutDateNode
-