@Service public class LogMessageService extends Object
| Modifier and Type | Field and Description |
|---|---|
private static String |
BACKWARD_SLASH |
static String |
DOT |
private static List<String> |
FORBIDDEN_SUFFIXES |
static String |
FOUR_SPACES |
static String |
LINE_SEPARATOR |
static String |
LOG_SEPARATOR |
private static String |
WORDS_SEPARATOR |
| Constructor and Description |
|---|
LogMessageService() |
| Modifier and Type | Method and Description |
|---|---|
private void |
appendEscapedToRow(int maxRowLength,
StringBuilder row,
String replaced,
boolean hasMoreTokens) |
private String |
escapeToken(String token) |
private int |
getForbiddenSuffixIndex(String token) |
private String |
moveForbiddenSuffixToNextLine(String[] tokens,
int i,
String escapedToken) |
String |
parseMessage(String line,
int maxRowLength)
Parse a message from a log line and split it to rows.
|
private String[] |
splitLongTokens(String[] tokens,
int maxRowLength) |
public static final String LINE_SEPARATOR
public static final String LOG_SEPARATOR
public static final String DOT
public static final String FOUR_SPACES
private static final String WORDS_SEPARATOR
private static final String BACKWARD_SLASH
private static final List<String> FORBIDDEN_SUFFIXES
public LogMessageService()
public String parseMessage(String line, int maxRowLength)
line - for example
04.03.2019 18:41:13.658|main|INFO |com.credibledoc.substitution.core.configuration.ConfigurationService - Properties loaded by ClassLoader from the resource: file..
maxRowLength - maximal number of characters in a row
Properties loaded by ClassLoa
der from the resource: file..
private String moveForbiddenSuffixToNextLine(String[] tokens, int i, String escapedToken)
private int getForbiddenSuffixIndex(String token)
private String[] splitLongTokens(String[] tokens, int maxRowLength)
private String escapeToken(String token)
private void appendEscapedToRow(int maxRowLength, StringBuilder row, String replaced, boolean hasMoreTokens)
Copyright © 2019. All rights reserved.