public class LogFileParser extends Object implements Runnable
Modifier and Type | Field and Description |
---|---|
private InputStream |
_in |
(package private) LogFactor5LoadingDialog |
_loadDialog |
private LogBrokerMonitor |
_monitor |
private static SimpleDateFormat |
_sdf |
static String |
ATTRIBUTE_DELIMITER |
static String |
CATEGORY_DELIMITER |
static String |
DATE_DELIMITER |
static String |
LOCATION_DELIMITER |
static String |
MESSAGE_DELIMITER |
static String |
NDC_DELIMITER |
static String |
PRIORITY_DELIMITER |
static String |
RECORD_DELIMITER |
static String |
THREAD_DELIMITER |
Constructor and Description |
---|
LogFileParser(File file) |
LogFileParser(InputStream stream) |
Modifier and Type | Method and Description |
---|---|
private LogRecord |
createLogRecord(String record) |
private void |
destroyDialog() |
protected void |
displayError(String message) |
private String |
getAttribute(int index,
String record) |
private String |
loadLogFile(InputStream stream)
Loads a log file from a web server into the LogFactor5 GUI.
|
void |
parse(LogBrokerMonitor monitor)
Starts a new thread to parse the log file and create a LogRecord.
|
private String |
parseAttribute(String name,
String record) |
private String |
parseCategory(String record) |
private long |
parseDate(String record) |
private String |
parseLocation(String record) |
private String |
parseMessage(String record) |
private String |
parseNDC(String record) |
private LogLevel |
parsePriority(String record) |
private String |
parseThread(String record) |
private String |
parseThrowable(String record) |
void |
run()
Parses the file and creates new log records and adds the record
to the monitor.
|
public static final String RECORD_DELIMITER
public static final String ATTRIBUTE_DELIMITER
public static final String DATE_DELIMITER
public static final String THREAD_DELIMITER
public static final String CATEGORY_DELIMITER
public static final String LOCATION_DELIMITER
public static final String MESSAGE_DELIMITER
public static final String PRIORITY_DELIMITER
public static final String NDC_DELIMITER
private static SimpleDateFormat _sdf
private LogBrokerMonitor _monitor
LogFactor5LoadingDialog _loadDialog
private InputStream _in
public LogFileParser(File file) throws IOException, FileNotFoundException
IOException
FileNotFoundException
public LogFileParser(InputStream stream) throws IOException
IOException
public void parse(LogBrokerMonitor monitor) throws RuntimeException
monitor
- LogBrokerMonitorRuntimeException
public void run()
protected void displayError(String message)
private void destroyDialog()
private String loadLogFile(InputStream stream) throws IOException
IOException
private String parseAttribute(String name, String record)
private LogLevel parsePriority(String record)
private String parseThread(String record)
private String parseCategory(String record)
private String parseLocation(String record)
private String parseMessage(String record)
private String parseThrowable(String record)
private LogRecord createLogRecord(String record)
private String getAttribute(int index, String record)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses