Class LogMetric.Rule
-
- All Implemented Interfaces:
public class LogMetric.Rule
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringKeypublic final static StringKey$enablepublic Stringfilepublic final static StringKey$filepublic DataSizeminGrowpublic final static StringKey$minGrowpublic DataSizemaxGrowpublic final static StringKey$maxGrowpublic DataSizemaxSizepublic final static StringKey$maxSizepublic intboundpublic final static StringKey$boundpublic Set<String>levelpublic final static StringKey$levelpublic Set<String>keywordpublic final static StringKey$keywordpublic intpreviewpublic final static StringKey$previewpublic intsectionpublic final static StringKey$sectionpublic Stringcharsetpublic final static StringKey$charsetpublic intcleanpublic final static StringKey$clean
-
Constructor Summary
Constructors Constructor Description LogMetric.Rule()
-
Method Summary
Modifier and Type Method Description StringgetFile()Monitored log file, no monitoring if file not found. voidsetFile(String file)Monitored log file, no monitoring if file not found. DataSizegetMinGrow()min growth per scan cycle, can be inherited voidsetMinGrow(DataSize minGrow)min growth per scan cycle, can be inherited DataSizegetMaxGrow()max growth per scan cycle, can be inherited voidsetMaxGrow(DataSize maxGrow)max growth per scan cycle, can be inherited DataSizegetMaxSize()max file size of log (archived daily), can be inherited voidsetMaxSize(DataSize maxSize)max file size of log (archived daily), can be inherited intgetBound()approximate separator of log header and content, separating byte numbers (char numbers if ASCII) voidsetBound(int bound)approximate separator of log header and content, separating byte numbers (char numbers if ASCII) Set<String>getLevel()log level keyword. voidsetLevel(Set<String> level)log level keyword. Set<String>getKeyword()log content (after level) keywords voidsetKeyword(Set<String> keyword)log content (after level) keywords intgetPreview()preview lines after found keyword voidsetPreview(int preview)preview lines after found keyword intgetSection()section size of intended lines voidsetSection(int section)section size of intended lines StringgetCharset()log charset voidsetCharset(String charset)log charset intgetClean()delete scanned files older than N days, `-1` means no cleaning voidsetClean(int clean)delete scanned files older than N days, `-1` means no cleaning StringtrimKey(String kw, boolean white)Remove the outer single quotes, and whether to handle subsequent whitespace StringmaskKey(String kw)Do NOT log the key. List<LogStat.Word>genStatKey()Auto remove a pair of quotes, construct bytes by charset List<String>genRuleKey()Auto remove a pair of quotes, merge level and its keyword booleanisEnable()whether to turn on, log file monitoring. booleanequals(@Nullable() Object o)inthashCode()StringtoString()voidsetEnable(boolean enable)whether to turn on, log file monitoring. -
-
Method Detail
-
getMinGrow
DataSize getMinGrow()
min growth per scan cycle, can be inherited
-
setMinGrow
void setMinGrow(DataSize minGrow)
min growth per scan cycle, can be inherited
-
getMaxGrow
DataSize getMaxGrow()
max growth per scan cycle, can be inherited
-
setMaxGrow
void setMaxGrow(DataSize maxGrow)
max growth per scan cycle, can be inherited
-
getMaxSize
DataSize getMaxSize()
max file size of log (archived daily), can be inherited
-
setMaxSize
void setMaxSize(DataSize maxSize)
max file size of log (archived daily), can be inherited
-
getBound
int getBound()
approximate separator of log header and content, separating byte numbers (char numbers if ASCII)
-
setBound
void setBound(int bound)
approximate separator of log header and content, separating byte numbers (char numbers if ASCII)
-
getLevel
Set<String> getLevel()
log level keyword. keywords will automatically trim a pair of leading and trailing quotes when executed. For example, `' ERROR '` becomes ` ERROR `, `'' WARN ''` becomes `' WARN '`.
-
setLevel
void setLevel(Set<String> level)
log level keyword. keywords will automatically trim a pair of leading and trailing quotes when executed. For example, `' ERROR '` becomes ` ERROR `, `'' WARN ''` becomes `' WARN '`.
-
getKeyword
Set<String> getKeyword()
log content (after level) keywords
-
setKeyword
void setKeyword(Set<String> keyword)
log content (after level) keywords
-
getPreview
int getPreview()
preview lines after found keyword
-
setPreview
void setPreview(int preview)
preview lines after found keyword
-
getSection
int getSection()
section size of intended lines
-
setSection
void setSection(int section)
section size of intended lines
-
getCharset
String getCharset()
log charset
-
setCharset
void setCharset(String charset)
log charset
-
getClean
int getClean()
delete scanned files older than N days, `-1` means no cleaning
-
setClean
void setClean(int clean)
delete scanned files older than N days, `-1` means no cleaning
-
trimKey
String trimKey(String kw, boolean white)
Remove the outer single quotes, and whether to handle subsequent whitespace
-
genStatKey
List<LogStat.Word> genStatKey()
Auto remove a pair of quotes, construct bytes by charset
-
genRuleKey
List<String> genRuleKey()
Auto remove a pair of quotes, merge level and its keyword
-
isEnable
boolean isEnable()
whether to turn on, log file monitoring. `default` provides default value for other rules.
-
hashCode
int hashCode()
-
setEnable
void setEnable(boolean enable)
whether to turn on, log file monitoring. `default` provides default value for other rules.
-
-
-
-